Download Learning the bash Shell, 3rd Edition

Transcript
Redirector Function
closed. If n is not specified, the standard
input (file descriptor 0) is used.
n>&digit-
Moves the file descriptor digit to file
descriptor n, or the standard output (file
descriptor 1) if n is not specified.
n<&digit-
Moves the file descriptor digit to file
descriptor n, or the standard input (file
descriptor 0) if n is not specified. digit is
closed after being duplicated to n.
Notice that some of the redirectors in Table 7-1 contain a
digit n, and that their descriptions contain the term file
descriptor; we'll cover that in a little while.
The first two new redirectors, >> and >|, are simple
variations on the standard output redirector >. The >>
appends to the output file (instead of overwriting it) if it
already exists; otherwise it acts exactly like >. A common
use of >> is for adding a line to an initialization file (such
as .bashrc or .mailrc) when you don't want to bother with
a text editor. For example:
432