Name
echo
Synopsis
echo [-eEn] [string]Built-in version. Write string to standard output.
Options
If the xpg_echo shell
option is set, along with POSIX mode (set
-o posix), echo does
not interpret any options.
-eEnable interpretation of the following escape sequences, which must be quoted (or escaped with a \) to prevent interpretation by the shell:
\aAlert (ASCII BEL).
\bBackspace.
\cSuppress the terminating newline (same as
-n).\eASCII Escape character.
\fFormfeed.
\nNewline.
\rCarriage return.
\tTab character.
\vVertical-tab character.
\\Backslash.
\0nnnASCII character represented by octal number nnn, where nnn is zero, one, two, or three digits and is preceded by a 0.
\nnnASCII character represented by octal number nnn, where nnn is one, two, or three digits.
\xHHASCII character represented by hexadecimal number HH, where HH is one or two hexadecimal digits.
-EDo not interpret escape sequences, even on systems where the default behavior of the built-in echo is to interpret them.
-nDo not print the terminating newline.
Examples
$echo "testing printer" | lp$echo "Warning: ringing bell \a"
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access