Questions tagged [echo]
echo is a common command to print a message onto an output device, like a display
116 questions
1
vote
1
answer
48
views
echo printf output in two lines for some expressions instead of one
Using Debian 12 stable.
The following echo works as expected, ie. the hardcode label and the result of the expression are displayed in the same line
echo "unzip version: $(unzip -v | head -1)&...
0
votes
2
answers
120
views
Can `find` piped to `echo` be used to do massive harm?
I am currently taking the Google cybersecurity coursera cert course. I am now in the Linux section and learning a few Linux commands, I am totally new to it but I was wondering about one thing. While ...
0
votes
1
answer
86
views
xargs and echo limited number of replacements
I want to duplicate some text a few times.
Xargs doesn't do more than 5 items.
I don't know if there is a better way to do this.
echo "sometext " | xargs -n 9 -t -I RRRR echo RRRR RRRR RRRR ...
0
votes
1
answer
41
views
Generating a script through CMD
I've been trying to find an answer to this peculiar question but haven't had any luck.
For work, I've been creating a tiny little script that would help my colleagues and I with the repetitive tasks ...
2
votes
1
answer
6k
views
silence echo without output to terminal
"NON-Compliance - PermitRootLogin" printed into output.log & test1.txt. I do NOT want to echo to the terminal. How can I do that?
echo "NON-Compliance - PermitRootLogin" | ...
0
votes
2
answers
1k
views
Calling a Recursive Function in a Batch File
I am currently trying to write a batch file for a project that will mimic the structure of the following pseudocode:
void h ( int n )
if ( n ≥ 4 )
h ( n / 2 )
end if
print ...
0
votes
1
answer
3k
views
Echo line to start of text file using Windows batch command?
This works to add the text my_new_text as the last line in all .txt files:
FOR /F "tokens=*" %%G IN ('dir /b *.txt') DO echo my_new_text>> "%%G"
Is there a simple edit that ...
1
vote
1
answer
1k
views
Echo variable which references another variable in shell script
Statement: "$k"_Id_avg="$(grep -i "$k"_Id_avg file.txt)"
and $k is a loop variable.
Now I want to print the value stored in the above variable, how can I do it?
I have ...
0
votes
1
answer
700
views
Why does `xargs` not work with `echo` but work with `ls`?
root@home:~$ ls
root@home:~$ echo abc > z1
root@home:~$ echo xyz > z2
root@home:~$ ls
z1 z2
root@home:~$ ls | xargs -I{} cat {}
abc
xyz
root@home:~$ echo z1 z2 | xargs -I{} cat {}
cat: 'z1 z2': ...
0
votes
1
answer
561
views
Can't insert correct "enable" secret password with Plink.exe for my Dell switch
I'm trying to use "Plink.exe" to connect throught SSH to my Dell switch N1548P and run "enable" command to enter EXEC mode. I'm using Plink with CMD in Windows 10. This is the ...
2
votes
0
answers
4k
views
Root Amazon Echo and install linux kernel - what programs can run on it? [closed]
I have an old v1 Echo that I want to experiment with. Using this guide, I see it's possible to root this Echo and install a custom linux kernel (2.6.x) on it: https://github.com/echohacking/wiki/wiki/...
1
vote
2
answers
907
views
Tail -f is not showing the update of the file when edited form editor
I have opened a file using tail -f <filename, and tried to append some texts in the same file from another tab using vim, the updated content is not showing. But if I append some texts using echo ...
1
vote
0
answers
941
views
Can anyone explain what are this numbers `echo -ne "\033]0;Title\007"` [duplicate]
I'm using them for setting the terminal title or terminal tab title but want to know what the numbers refer to.
Could anyone please give me a hint on where I can find that info?
1
vote
2
answers
2k
views
Spectrum Router not allowing ICMP Echo Requests
I am currently trying to set up a server off of my Windows 10 PC, after lots of troubleshooting I have concluded that my router is blocking ICMP Echo requests (AKA Ping) from reaching my computer. ...
4
votes
3
answers
8k
views
Difference between Echo and Write-Host in PowerShell ISE
I'm starting to learn (beginner) about PowerShell script. I found that echo and Write-Host both can display output in the console screen, so what is the difference between them? I read this question ...
1
vote
2
answers
3k
views
(git) Bash: how exactly does a line break differ from \n in a variable?
My apologies, I must have made some mistakes when performing the initial tests, as after putting everything into a single script the xxd output does indeed always match the stdouput.
The entire script ...
0
votes
0
answers
831
views
use echo to write to file and include single quotes
I have the command here
doctl compute ssh testdroplet --ssh-command 'echo -e "import http.server\nimport socketserver\nfrom http import HTTPStatus\n\nclass Handler(http.server....
0
votes
1
answer
4k
views
Supress stdout except for echo commands but show stderr
I have put a very large bash script together that installs packages and configures a LAMP stack etc. With any scripting I usually do, I like to tidy it up by using echo commands to let the user ...
1
vote
2
answers
2k
views
7zip password protected zip - SHOW the password that i type
wondered if, when i unzip a pasword protected file and it says "enter the password, it will not be echoed" if i could see either what i type or paste (echoed!) OR a ***** to show that what i'...
1
vote
0
answers
656
views
CMD echo working with PLINK>exe
good day, I tried to use the format below for my plink and when I went to login with the username I changed the password on it didn't accept the new password. so my question is, when using "(...
0
votes
1
answer
674
views
Create a Automate script and use another script is echo password
I have created a fully automated script which uses ssh login to login from one server to another and do some file operation, but the script is not fully automated as it prompts for a password, we do ...
6
votes
3
answers
3k
views
How do I create a command on Windows without having to create a file?
I want to create the command hello without having to create a file like hello.bat.
I want the command without the file.
The command must execute an echo Hello World!.
Is there a way to do it on ...
0
votes
1
answer
174
views
Is it possible to make a bash script to simplify using echo to overwrite the same text file with new text?
What I'm trying to do is simplify using echo as I will be overwriting the same file each time with different text.
Currently I'm using this in the terminal:
echo "blah blah blah blah" > /home/...
1
vote
1
answer
80
views
What is echo doing?
Recently, I noticed that echos in which I include lots of "!" result in weird stuff. For example: echo !! gives me:
echo rm -r * 1000
rm -r * 1000
(rm -r * was the last command I executed before ...
3
votes
4
answers
2k
views
redirect echo in a cmd batch file to a variable fail
I use the below function to check if echo is set on or off, and as you can see it pipes echo statuse and then uses the output to set a flag:
FUNCTION
:echos
echo > echo.txt & rem pipe ech ...
0
votes
2
answers
19k
views
How to connect Echo Dot to University protected wifi
I recently won an Echo dot in a Hackathon and I was very excited to try it out but sadly the dot does not connect to 'Eduroam', the university network. The Uni site says that eduroam uses '802.1x ...
0
votes
1
answer
4k
views
whitespace padding a file length using echo in a windows batch file
I'm using a for loop in a windows .bat file to make a text-file listing files in directories.
FOR /R %%G in (*) DO (
ECHO %%~zG %%~nxG >> zzz-list.txt
)
[Phone won't let me input a tab ...
0
votes
0
answers
377
views
Blue Snowball Ice usb mic has echo sound
I use the Blue Snowball Ice usb mic. I have put mic around 6 - 12 inches from my mouth. I have used screen cast ometic Normalize and Reduce Noice functionalities of that tool. But I can hear a big ...
0
votes
1
answer
337
views
My echo file is returning the incorrect order for files
So I'm using FFmpeg to join a list of .ts files together, to do this I need to create an echo file with all the names of the .ts files in chronological order. The files are all named as numbers, in my ...
1
vote
1
answer
763
views
Dir piped into Set
Im trying to make a program that selects a file name, then pipes it into a variable.
My Attempt:
Dir /B "C:\Program Files (x86)\ServerMaster\Internals\Versions\Van1" | (set /p myVar= & set myVar)...
1
vote
1
answer
677
views
Difference between echo $(cal) and echo "$(cal)" [duplicate]
I'm using echo $(cal) and echo "$(cal)"in Linux and it gives me different results as in the picture. The double quotes should not interfere with $ in this case, so what gives the echo "$(cal)" that ...
0
votes
2
answers
332
views
How to redirect output to a file so the previous redirected output is not lost?
I'm quite new to all this, trying to run a basic batch file to output some commands to a document.
It works fine until I add some more echos in.
Example:
echo "Failed Drives" > Report.rtf
...
1
vote
2
answers
3k
views
bash script:echo output garbled and in wrong order
I am having an issue with a bash script that is echoing output in an unexpected order. The script is as follows. The problem is with the output of lines 30-32.
1 IFS=$'\n'
2 i=1
3 bluered=""
4 ...
0
votes
1
answer
1k
views
How to read a .txt file in a batch script on a network? [closed]
I'm making a little game because I was bored and I want it to work in a LAN network, my map files are in a shared file. When I try to echo the contents nothing comes out.
Here is the code:
(
...
0
votes
1
answer
2k
views
Add variable space at the end of line in file
I want to add white space at the end of each line. Number of white space is in variable. If number of white space is fixed then I can use this command
sed 's/$/ /g'
for two spaces.
space_variable=...
0
votes
1
answer
712
views
How reinstall the /bin/echo in my debian?
Something wrong for my /bin/echo command.
sudo ls -al /bin/echo
-rwxr-xr-x 1 root utmp 0 Nov 11 18:05 /bin/echo
method1 to fix it:
I knew that /bin/echo is in coretils.
Remove coreutils first then ...
0
votes
3
answers
3k
views
find: ‘echo’: Permission denied
It is my os info:
sudo uname -a
Linux machine 4.9.0-8-amd64 #1 SMP Debian 4.9.110-3+deb9u6
(2018-10-08) x86_64 GNU/Linux
Files beginning at test in /tmp.
ls -al test*
-rw-r--r-- 1 debian9 ...
0
votes
1
answer
2k
views
How to create a file with multiple lines and / - Windows Command Prompt
How can I create a file with multiple lines, / and " ?
I am trying to create a scss file where I the text has multiple lines, / and "
Is there any way where I don't have
Here is the code I have ...
1
vote
0
answers
718
views
Batch Banner colored only
I would like to have the banner that I call always in red let's say and all the other text be white.
How can I do ?
Thank you.
:BANNER
CLS
echo ___ _ _____
echo ...
1
vote
1
answer
439
views
Set arbitrary text to windows clipboard
I'm using clip to set text on the clipboard.
To do that, I use echo.
echo Works|clip
The problem is when the text contains special characters, eg. | ".
echo (TRUE|FALSE)|clip
echo " is a Quote Mark|...
2
votes
2
answers
11k
views
use echo and another command in the same line in batch file
For for this code
echo x set /p "a=>"
result will be
x set /p "a=>"
The result i want is
x>
Please help,thanks
38
votes
2
answers
10k
views
What is wrong with “echo $(stuff)” or “echo `stuff`”?
I used one of the following
echo $(stuff)
echo `stuff`
(where stuff is e.g. pwd or date or something more complicated).
Then I was told this syntax is wrong, bad practice, non-elegant, excessive, ...
0
votes
2
answers
4k
views
Echo: Multiple commands
Hoi everybody,
I am currently struggling with having to execute multiple commands in an echo. The following line is an example of the problem I am having:
echo (cd .. && pwd)
The idea is, ...
5
votes
1
answer
14k
views
append to end to line without newline
When i try to append to the end of a file it creates a new line. Now I have tried to fix this with echo -n but that doenst work.
So what am I trying. I'm trying to get the following result:
Hello
...
0
votes
1
answer
63
views
How to echo from web to a file in windows terminal?
What I want is to run a command in a terminal that will download a Visual Studio git ignore raw file, save it to .gitignore file in a folder where my terminal is opened on my Windows 10 machine.
I've ...
2
votes
1
answer
3k
views
Eval and echo use together
I want to know if the code below can be improved of how it is written is the way to write it. If it wasn't clear I am a newbie to bash but my script completes its purpose.
This code is trying to ...
1
vote
2
answers
102
views
Bash echo from input file with additional data
I currently have thousands of .jdx files and I've managed to find a way to get the lines I need from the files echoed into a new file. What I cant seem to do is get the additional data I need to be ...
19
votes
7
answers
58k
views
Cat command and echo
I'd like to concatenate the output from echo with content of a file. I've tried the following comand:
echo "abc" | cat 1.txt > 2.txt
but the 2.txt file only contains the content from 1.txt. Why ...
4
votes
2
answers
2k
views
Writing ECHO output to VBS File not working
I am writing a Batch Script that creates a VB Script by echoing each line and directing the output to the created file. It works for the most part, except for two lines that get Command Line variables ...
2
votes
1
answer
74
views
echo command issue on Unix server
I am trying to copy some configurations to unix endpoint using below echo command, after copying i see few characters are missing or sometimes gets prefixes. example below.
need your suggestion here....