STDIN, STDOUT, STDERR, Piping, and Redirecting
Operating systems recognize a couple special file descriptor IDs:
STDIN
-0
- Input usally coming in from keyboard.STDOUT
-1
- Output from the application that is meant to consumed by the user, stored in a file, or piped to another application for parsing. Typically goes to terminal.STDERR
-2
- Used for info, debug, and error messages to the user that are not intended to specifically be part of the application output. Typically goes to terminal.
This guide will look at how you can redirect and pipe these streams for better application development and system administration.