================================== No standard for the "echo" command ================================== -IAN! idallen@ncf.ca In the beginning, the Unix "echo" command had no way of suppressing the newline that it always added after outputting its arguments. The Berkeley people added a "-n" option to suppress the newline; the AT&T people chose to use an embedded "\c" to do the same thing. (To make money, you must distinguish your product from your competitors.) Most shells contain a built-in "echo" command, and depending on the origin of the shell, it either honours the "-n" or the "\c". The C Shell (including tcsh) always uses "-n". The Bourne shell derivatives usually use "\c", except for "bash", which uses "-n" by default; but, can be told to use "\c" using the non-standard "-e" option to "echo". Depending on from where you get your version of Unix, and which shell you use, you will have to use either "-n" or "\c" to suppress a newline. Unfortunately, if you want to write a portable shell script that will work on any machine, you can't use either of these. One way around the problem is to use Unix commands that always work on all versions of Unix. Here's one such work-around to suppress the newline: echo "This has no newline:" | tr -d '\n' I believe this works in all popular shells and on all versions of Unix you're likely to encounter, at least until Microsoft adopts their own version of Unix and "embraces and extends" the interface to include a third incompatible way of doing things. If the text message is intended to appear on standard error (not standard output), such as you would intend for a prompt, you must redirect the output of the translate, not the output of the echo: Correct redirection (message appears on standard error): echo "This has no newline:" | tr 1>&2 -d '\n' Incorrect (message appears on standard error but is NOT translated): echo 1>&2 "This is wrong; it still has the newline:" | tr -d '\n'