The echo tag has no wiki summary.
1
vote
1answer
36 views
How to prepend contents of a file to another
This question relates to the already asked question How to add text to beginning of file
The answer suggested by Dennis Williamson does the job:
echo 'task goes here' | cat - todo.txt > temp ...
2
votes
2answers
34 views
Use xargs to send requests to the same server in parallel with netcat
I am trying to devise a one-liner to send text to a simple echo server - but multiple connections in parallel. This is what I'm trying:
echo -e A,B,C,D | xargs -d, -i -P 4 echo {} | nc localhost ...
0
votes
2answers
61 views
Internal and external ip
How to find the internal IP and external IP of a linux server by connecting to it using Putty?
Secondly, what is the IP address given by the echo $SSH_CLIENT command, is it internal or external?
My ...
1
vote
0answers
33 views
Terminal without echo
In the terminal on Solaris 5.9 (ksh), I don't see the characters when typing. I can see the input only after the return key is pressed.
I checked terminal settings with stty -a it shows:
echo echoe ...
0
votes
1answer
65 views
How to get GNU-Screen Command in Linux to echo locally
I'm looking to run screen
screen /dev/ttyS0 115200
and echo my commands locally. This is one of those rare phrases where google spits out a lot of irrelevant results.
1
vote
1answer
95 views
Virtual Windows Server 2008 R2 system unexpectedly responds on TCP echo port 7
We have a virtual system running Windows Server 2008 R2, and it responds on TCP port 7 (echo). (I.e, in response to a SYN it sends ACK,RST, which is enough to make InetAddress#isReachable() return ...
1
vote
2answers
71 views
Change encoding of txt file
When I write :
file file1.txt
I have this output : Little-endian UTF-16 Unicode text, with CR line terminators
Then if I write :
file file2.txt
I have : ASCII text
file2.txt is created by ...
0
votes
2answers
600 views
How do I create a multiline text file with Echo in Windows command prompt?
I'm using Windows 7 and I would like to quickly create a small text file with a few lines of text in the Command prompt.
I can create a single line text file with:
echo hello > myfile.txt
but ...
2
votes
1answer
65 views
Need to pass runtime parameters using echo
I have test.exe application which I run and it ask to enter password twice. In Unix I have seen this can be run using echo command for silent execution without editing the test.exe.
In Unix:
echo ...
3
votes
1answer
81 views
Linux shell scripting: unexpected variable behavior
I have a variable $myvar that contains two lines, and I want to put first of them into a new variable.
When I try:
$ myvar1 = $(echo $myvar | head -n 1)
It doesn't work because echo doesn't ...
3
votes
1answer
68 views
I can't echo an echo of a mixed up string into a file
This line works as expected on it's own
(echo '@$X!'; sleep 3; echo '@$X!')
And I need to insert this line in a file using the following command, but it's not working. The echo'ed command must be ...
1
vote
4answers
152 views
How to escape newline in the commandline?
I need to do this:
$ echo '
File
Contents
' > my-file
The problem is that the resulting file contains a newline at the beginning and at the end.
I tried this but didn't work:
$ echo '\
File
...
2
votes
2answers
336 views
How to print new line character with echo?
I dump a string with hexdump like this 2031 3334 2e30 0a32 2032 3331 302e 000a. It is clear that 0x0a is new line character, however, when I try to echo this string out, I always got 1 430.2 2 13.0 -- ...
2
votes
2answers
738 views
A Unix shell command alternative to echo
I'm trying to output string literals to a file. So far I've been trying to use the echo command, but unfortunately I've discovered it's impossible to output '-n', '-e' or '-E' (at least not without ...
0
votes
1answer
56 views
Characters typed won't appear in the command line when connected via TELNET
On Windows XP, I changed the localecho field by setting it to ON, but after I quit telnet and make a connection in the command line, the localecho field is set again to OFF. Anyone know how to handle ...
1
vote
2answers
1k views
equivalent “echo on” for linux?
How can I get to stdout all commands that run in bash script?
That is output must contain commands output AND commands themselves.
I found
#!/bin/bash -x
but this is not exactly the same because ...
2
votes
2answers
567 views
Can a string be inserted at a specific line in a file from the CLI?
The file has the content:
[Greet]
Hello
Hi
Hola
I want to add a string called Hey so that its position is after Hello:
[Greet]
Hello
Hey
Hi
Hola
Is there a way to do the above by using echo or ...
4
votes
2answers
14k views
Shell script echo new line to file
I want to echo a new line to a file in between variables in a shell script. Here's my code:
var1="Hello"
var2="World!"
logwrite="$var1 [Here's where I want to insert a new line] $var2
echo ...
1
vote
1answer
226 views
In a for loop, how do I echo only the current file on a single(updating) line instead of EVERY file which will produce a list?
My first question on this stackexchange, and I am sure there will be more as I venture farther into the world of what is Linux...
I have a for-loop in a shell-script that batch renames all files to a ...
7
votes
1answer
2k views
how to escape pipe symbol | in bat scripts?
I need to echo commad usage like this in batch script named command.bat
command.bat on|off
I cant use
echo %0 on|off
I know I can use
echo "%0 on|off"
but it puts quotes along
Is there any ...
0
votes
2answers
610 views
.bashrc reports unexpected EOF
I am trying to add some functions to my bashrc, namely:
h () { history | fgrep $1 | sort -u | cut -b 8- }
extract () {
if [ -f $1 ] ; then
case $1 in
*.tar.bz2) tar xvjf $1 ;;
...
3
votes
3answers
3k views
On a Linux shell, what is echo $1 supposed to do?
I do a echo $1, it prints out what is the default login shell used.
But for echo $2 onwards, all I get is a newline. Why is that?
