Well, it might also be even simpler than that.
"Every Linux/Unix program" has the notion that it reads its input from STDIN, writes its output to STDOUT, and sends its error-messages to STDERR. All three of these names are abstract names: you can define, on the fly, what these input-files belong to.
By default, STDIN will be "your terminal" and both STDOUT and STDERR will also be "your terminal."
Now, let's say that this time
when I run my program, I want to read the input from one file, write the output to another, and simply dispose-of any errors.
myprogram <inputfile >outputfile 2>/dev/null
" is a pseudo-device that consumes anything written to it. The "bit-bucket...")
What if we'd like to pipe
the output of one program straight into the mouth of another one? Easy:
"Get to know the Unix shell(s)." The time will be well-spent.
Originally Posted by Dorothy
I don't think we're in Redmond anymore, Toto...