echo is a common command to print a message onto an output device, like a display

learn more… | top users | synonyms

0
votes
3answers
46 views

Batch script If command on a String

What is wrong with the following command lines for my batch script? set test=BE99012345678901 if %test% == "BE99????????????"( echo This number begins with BE99 ) Else ( echo This number doesn't ...
1
vote
4answers
96 views

SSH: How to change value in config file in one command

How can I change the value of, let's say, PasswordAuthentication in /etc/ssh/sshd_config in commands? As well, remove a # in front of the "key" I wish to value. These don't all have to be in one ...
1
vote
1answer
45 views

Avoid extra eol in echo

Echo produces an EOL and there is no way (at least it is very difficult to find) to echo EOL alone. The first problem is that echo 0 > myfile & echo " 11" >> myfile produces a file ...
2
votes
1answer
142 views

How does `echo` work in this context?: `externalip() { curl http://ipecho.net/plain; echo; }`

While searching for a simple bash function that echoes my external IP address, I came across this post, which had the following example: function ext-ip () { curl http://ipecho.net/plain; echo; } ...
0
votes
2answers
35 views

How to input text in a file in a specific line?

what am trying to do is to input the command sudo in a file with echo or something similar but not in the first line but in another line after a text ie. I have this text line[4]command=sh -c ...
0
votes
1answer
24 views

HP Mini 1000 Horrible Echo

EDIT: OS is Windows XP Home Premium SP2. The echo only seems to happen when using Adobe Flash...hmph, just another reason to hate Flash. Recording seems fine with WAV files, as well as Skype, but a ...
1
vote
1answer
38 views

space at the end of variable is killed on output

I'm on Ubuntu 12.04 with bash 4.2.25(1)-release. If I use #!/bin/bash echo -n 'test ' > text; echo 'test2' >> text; everything works fine and the output of text is test test2. But if I use ...
0
votes
4answers
47 views

Possible to display all files in the current dir with a filename that does not start with an even digit followed by any alphabetic letter?

I am attempting to answer this problem for a COSC class that focuses on Linux/Unix. I am using Linux with bash shell. I am new to Linux as of September. My instructor has this question in this ...
0
votes
1answer
59 views

Behavior of ECHO command and variable definition in Unix

Can't post the image directly yet, so here's a link to it: http://i.imgur.com/sjPVNU6.png I'm trying to learn some basic unix file scripting for an Informatica project I'm working on. I've used a few ...
0
votes
1answer
179 views

Why does echo work through pipe but not cat with msmtp?

This works: echo "yada yada" | msmtp my@mail.com but not this: cat yadayada.txt | msmtp my@mail.com which delivers the email with empty content. Why does echo work through pipe but not ...
0
votes
0answers
226 views

Firewall is blocking echo request on port 7 (TCP)

I have an app which needs to receive a message back from the server. With the firewall on, I do not get the message back. If I turn off the firewall I get the request back. I have added some rules ...
1
vote
1answer
174 views

Why the here-strings in bash are slower than piping the input to a command?

I compared the execution time for unix here-strings and pipe data input to bc: pipe time for i in {1..1000} do echo "sqrt(5.09)" | bc -q > /dev/null done real 0m3.584s user ...
1
vote
1answer
90 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
3answers
179 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 ...
1
vote
0answers
147 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 ...
3
votes
1answer
374 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
372 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
2k 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 ...
4
votes
2answers
8k 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
101 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
102 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
108 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
396 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
2k 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 -- ...
0
votes
1answer
84 views

PHP Input Output is stuck? [closed]

<?php mysql_connect("localhost", "root", "pass") or die("Could not connect: " . mysql_error()); mysql_select_db("smcs"); $result = mysql_query("SELECT * FROM others"); $row = ...
2
votes
2answers
2k 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
106 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 ...
7
votes
2answers
5k 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
1k 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
27k 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
301 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 ...
8
votes
1answer
4k 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
905 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 ;; ...
4
votes
3answers
7k 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?