echo
[
-n
] [
string
]
Write string
to standard output; if -n
is specified, the output is not terminated by a newline. If no string
is supplied, echo a newline. In the Korn shell, echo
is built-in, and it emulates the system's real echo
command.[
] (See also echo
in Chapter 2
.) echo
understands special escape characters, which must be quoted (or escaped with a \) to prevent interpretation by the shell:
\a
Alert (ASCII BEL). (Not in /bin/sh
's echo
.)
\b
Backspace.
\c
Suppress the terminating newline (same as -n
).
\f
Formfeed.
\n
Newline.
\r
Carriage return.
\t
Tab character.
\v
Vertical-tab character.
\\
Backslash.
\0
nnn
ASCII character represented by octal number nnn
, where nnn
is one, two, or three digits and is preceded by a 0.
$ echo "testing printer" | lp
$ echo "Warning: ringing bell \a"