Echo


From Knoppix Documentation Wiki
Revision as of 23:58, 25 September 2005 by Dr Kludge (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

echo is a Linux bash shell scripting command. Other shell scripting languages also have an echo command. The purpose of the command is to display text in your scripts.

Examples

echo $PATH

This version is used to look at the contents of a shell varaible. In this case, the contents of the PATH variable are displayed.

echo 'Show me the money' > cash.out

This version shows how a echo can be used to create files. The output of echo is sent to the file called cash.out. The greater than sign, > is used with a technique called redirection.

echo ^O^G

echo can be used to set terminal settings. If you use the hat character, shift 6 key on US English keyboards, this sequence will not reset a foobared terminal. The hat character repersents the escape character, ASCII 27. The control key and [ key are used to create the escape character.