[Next] [Previous] [Up] [Top] [Contents]

3.8 Display Commands

3.8.1 echo - echo a statement

The echo command is used to repeat, or echo, the argument you give it back to the standard output device. It normally ends with a line-feed, but you can specify an option to prevent this.


echo [string]

Common Options

-n don't print <new-line> (BSD, shell built-in)

\c don't print <new-line> (SVR4)

\0n where n is the 8-bit ASCII character code (SVR4)

\t tab (SVR4)

\f form-feed (SVR4)

\n new-line (SVR4)

\v vertical tab (SVR4)


% echo Hello Class or echo "Hello Class"

To prevent the line feed:

% echo -n Hello Class or echo "Hello Class \c"

where the style to use in the last example depends on the echo command in use.

The \x options must be within pairs of single or double quotes, with or without other string characters.

Introduction to Unix - 14 AUG 1996
[Next] [Previous] [Up] [Top] [Contents]