home | O'Reilly's CD bookshelfs | FreeBSD | Linux | Cisco | Cisco Exam    


echo [-n ] [string ]

Write string to standard output; if -n is specified, the output is not terminated by a newline. If no string is supplied, echo a newline. In the Korn shell, echo is built-in, and it emulates the system's real echo command.[2 ] (See also echo in Chapter 2 .) echo understands special escape characters, which must be quoted (or escaped with a \) to prevent interpretation by the shell:

[2] But, if a path search finds /usr/bin/echo , the ksh built-in echo doesn't accept the -n option. (The situation with echo is a mess; consider using printf instead.)


Alert (ASCII BEL). (Not in /bin/sh 's echo .)




Suppress the terminating newline (same as -n ).






Carriage return.


Tab character.


Vertical-tab character.



\0 nnn

ASCII character represented by octal number nnn , where nnn is one, two, or three digits and is preceded by a 0.


$ echo "testing printer" | lp

$ echo "Warning: ringing bell \a"

Previous: Reference: done UNIX in a Nutshell: System V Edition Next: Reference: esac
Reference: done Book Index Reference: esac

The UNIX CD Bookshelf NavigationThe UNIX CD BookshelfUNIX Power ToolsUNIX in a NutshellLearning the vi Editorsed & awkLearning the Korn ShellLearning the UNIX Operating System