Name

echo — Output some text to standard output

Synopsis

echo [-n] [-e] {text}

Options

-n

do not output the trailing newline

-e

enable interpretation of the backslash-escaped characters

text

text to display

Description

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

CharacterResult
\0NNNthe character whose ASCII code is NNN (octal)
\\backslash
\aalert (BEL)
\bbackspace
\csuppress trailing newline (same as the -n option)
\fform feed
\nnew line
\rcarriage return
\thorizontal tab
\vvertical tab


Example 10.1. Using the echo command

>echo pepper;echo fish 
pepper 
fish 
>echo -n pepper;echo fish 
pepperfish 
>