Echo


From Knoppix Documentation Wiki
Revision as of 02:53, 1 October 2005 by 204.11.230.89 (Talk)

(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 echo can be used to put text into a file. The greater than sign > is a shell redirection, which causes the output of a given command to be redirected into the specified file. The output of echo is thus redirected into the file named cash.out.

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.