echo [ -n ] [ arg ... ]
The echo command writes its arguments separated by blanks
and terminated by a new line on the standard output. The
-n option prints a line without the newline; this is the
same as using the ``\c'' escape sequence if it is placed at
the end of the list of arguments.
However, POSIX.2 and the X/Open CAE Specification, Commands and Utilities, Issue 4, 1992 do not support the
-n option, so if you are using /bin/posix/echo
rather than /bin/echo, the newline will always be printed.
In this case, it may be suppressed using the
echo also understands C-like escape conventions; beware of
conflicts with the shell's use of ``\'':
For the octal equivalents of each character, see
alert character (for example, ASCII BEL)
ignore all subsequent arguments, and do not output a newline
The 8-bit character whose ASCII code is a
0, 1, 2 or 3-digit octal number n. To prevent the argument
being quoted literally, it must be escaped from the shell. For
echoes the number ``5''
echoes the letter ``A''
The echo command is useful for producing diagnostics in
command files and for sending known data into a pipe.
A version of this command is built into
When representing an 8-bit character by using the escape convention
\0n, the octal number n must
always be preceded by the digit zero (0).
For example, typing: echo "WARNING:\07" will
print the phrase ``
WARNING:'' and sound the ``bell'' on
your terminal. The use of single (or double) quotes (or two
backslashes) is required to protect the ``\'' that precedes
The version of echo built into
only supports the escape sequences ``\c'' and ``\n''.
echo is conformant with:
ISO/IEC DIS 99452:1992, Information technology Portable Operating System Interface (POSIX) Part 2: Shell and Utilities (IEEE Std 1003.21992);
AT&T SVID Issue 2;
X/Open CAE Specification, Commands and Utilities, Issue 4, 1992.
© 2003 Caldera International, Inc. All rights reserved.
SCO OpenServer Release 5.0.7 -- 11 February 2003