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

learn more… | top users | synonyms

1
vote
3answers
42 views

Most efficient log “echo date”?

My coworkers write scripts with lines like this: echo "nightly $MACHINE restart begins at" `date` Which outputs something like this: nightly whitestar restart begins at Mon Oct 13 22:05:01 EDT ...
0
votes
3answers
70 views

Why is this echo command not working?

I want to overwrite /etc/postfix/master.cf with my own content. I'm using echo "<content>" > /etc/postfix/master.cf to try and accomplish this. But when I do: echo "# # Postfix master ...
0
votes
1answer
41 views

“echo” prints the options in crontab

I'm running Rasbian 3.12.26+ on a Pi model B. Here is what my cron entry looks like: * * * * * sleep 11; { echo -en "\e[1;4;33m"; date; echo -en "\e[0m"; curl -k "http://sampleurl.com/update.php"; ...
0
votes
3answers
65 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
260 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
55 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
274 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
41 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
26 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
45 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
51 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
71 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
230 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
282 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
217 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
103 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
227 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
209 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
438 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
423 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 ...
3
votes
2answers
4k 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 ...
7
votes
2answers
11k 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
116 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
117 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
119 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
516 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 ...
3
votes
2answers
7k 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
86 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
3k 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
115 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 ...
8
votes
2answers
7k 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
2k 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
31k 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
314 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
5k 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
993 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
8k 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?