ECHO(1) User Commands ECHO(1)

echo - echo arguments

echo [argument ...]

Echo writes its arguments separated by blanks and terminated by a newline on the standard output.

Echo is useful for producing diagnostics in shell programs and for writing constant data on pipes. To send diagnostics to the standard error file, do `echo ... 1>&2'.

The following escapes sequences are recognized in the arguments:

Prints an alert character (/usr/5bin/posix/echo and /usr/5bin/posix2001/echo only).
Prints a backspace character.
Causes the command to return immediately. Any following characters are ignored, and the terminating newline is not printed.
Prints a formfeed character.
Prints a newline character.
Prints a carriage-return character.
Prints a tabulator character.
Prints a vertical tabulator character.
\\
Prints a backslash character.
\0nnn
Prints the character (byte) with octal value nnn.

See locale(7).
Determines the scope of backslash as an escape character.
If this variable is set and the first argument is -n, the terminating newline is not printed.

printf(1)

It is recommended for portability that printf(1) is used instead of echo if backslashes are to be printed or if the trailing newline is to be omitted.

7/2/05 Heirloom Toolchest