February 2001
Beginner to intermediate
448 pages
9h 2m
English
Official Description
Writes its arguments to standard output.
Syntax
echo [-n] [string...]
Options
-n requests that no newline is added to the output.
Oddities
Many special characters are recognized (such as \n, which means newline; \t, which means tab; and so on).
echo is not as portable as the print built-in command.
Example
$ type echo # Echo is built into some implementations of ksh echo is a shell built-in $ $ echo -n "What now? " # The built-in does not recognize the –n option -n What now? $ $ whereis echo # The echo program is in /bin echo: /bin/echo /usr/man/man1/echo.1 $ $ /bin/echo -n "What now? " # It recognizes the –n option What now? $ # Note that the prompt appears on the same line $
Read now
Unlock full access