echo — Output some text to standard output
echo
[-n] [-e] {text}
-n
do not output the trailing newline
-e
enable interpretation of the backslash-escaped characters
text
text to display
This command is used to display text on the output console. One use is in scripts to indicate what actions are being performed.
If the -e
option is used, the following sequences are recognised:
Table 10.1. Escaped echo characters
Character | Result |
---|---|
\0NNN | the character whose ASCII code is NNN (octal) |
\\ | backslash |
\a | alert (BEL) |
\b | backspace |
\c | suppress trailing newline (same as the -n option) |
\f | form feed |
\n | new line |
\r | carriage return |
\t | horizontal tab |
\v | vertical tab |
Example 10.1. Using the echo command
>echo pepper;echo fish pepper fish >echo -n pepper;echo fish pepperfish >