上QQ阅读APP看书,第一时间看更新
Getting ready
Shell scripts frequently use standard input (stdin), standard output (stdout), and standard error (stderr). A script can redirect output to a file with the greater-than symbol. Text generated by a command may be normal output or an error message. By default, both normal output (stdout) and error messages (stderr) are sent to the display. The two streams can be separated by specifying a specific descriptor for each stream.
File descriptors are integers associated with an opened file or data stream. File descriptors 0, 1, and 2 are reserved, as given here:
- 0: stdin
- 1: stdout
- 2: stderr