I/O Redirection
Table A-10 is a complete list of I/O redirectors. Note that there are two
formats for specifying STDOUT and STDERR redirection:
&>file and
>&file. The second of these (which is
the one used throughout this book) is the preferred way.
Table A-10. Input/output redirection
Redirector | Function |
|---|---|
| Pipe; take standard output of
|
> | Direct standard output to
|
< | Take standard input from
|
>>
| Direct standard output to
|
>| | Force standard output to
|
n>| | Force output to |
<>
| Use |
| Use |
<<
| Here-document. |
<<<
| Here-string. |
n> | Direct file descriptor |
n< | Take file descriptor |
n>>
| Direct file descriptor |
| Duplicate standard output to file descriptor
|
| Duplicate standard input from file descriptor
|
| File descriptor |
| File descriptor |
&> | Directs standard output and standard error to
|
<&- | Close the standard input. |
>&- | Close the standard output. |
| Close the output from file descriptor
|
| Close the input from file descriptor
|
| If |
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access