echo

display arguments

Command


SYNOPSIS

echo argument...


DESCRIPTION

echo writes its arguments to the standard output. echo accepts these C-style escape sequences:
\a
bell
\b
backspace
\c
removes any following characters including \n and \r
\f
formfeed
\n
newline
\r
carriage return
\t
horizontal tab
\v
vertical tab
\0num
the byte with the numeric value specified by the zero to three digit octal num
\\
backslash
echo follows the final argument with a newline unless it finds \c in the arguments. Arguments are subject to standard argument manipulation.


EXAMPLES

One use of echo is to expand file names on the command line, as in:
echo *.[ch]
This displays the names of all files with names ending in .c or .h, typically C source and header files. echo displays the names on a single line. If there are no file names in the current directory that end in .c or .h, echo simply displays the string *.[ch].

echo is also handy for passing small amounts of input to other filters:
echo 'this is\nreal handy' | banner


DIAGNOSTICS

echo always returns the status value:
0

Successful completion.


PORTABILITY

POSIX.2. x/OPEN Portability Guide 4.0.

The POSIX.2 standard does not include the escape sequences, so a strictly conforming application cannot use them. printf is suggested as a replacement.

On older UNIX systems, the backslash escape sequences are not available; the -n option is equivalent to \c embedded in an argument.


NOTE

echo is provided as both an external utility and a built-in MKS KornShell utility.


SEE ALSO

Commands:
sh


Updated MKS Toolkit [3khat16.ico]HP3000 [3khat16.ico]3kMail [archive16.gif]