Now we'll zoom back in to the string I/O level and examine the echo and read statements, which give the shell I/O capabilities that are more analogous to those of conventional programming languages.
As we've seen countless times in this book, echo simply prints its arguments to standard output. Now we'll explore the command in greater detail.
echo accepts a few dash options, listed in Table 7.2.
echo accepts a number of escape sequences that start with a backslash. [2]These are similar to the escape sequences recognized by echo and the C language; they are listed in Table 7.3.
[2] You must use a double backslash if you don't surround the string that contains them with quotes; otherwise, the shell itself "steals" a backslash before passing the arguments to echo.
These sequences exhibit fairly predictable behavior, except for \f: on some displays, it causes a screen clear, while on others it causes a line feed. It ejects the page on most printers. \v is somewhat obsolete; it usually causes a line feed.
[3]