Linux Format

About standard input, output and error

-

Unix applies a concept of standard streams of data, which means that each program automatica­lly gets access to three data streams: input, output and error.

Each standard stream has a file descriptor associated with, 0, 1 and 2 respective­ly. A file descriptor is just a number used for referring to an open file. The following command shows how to use a single file as an input to another file:

Note: This method doesn’t work with multiple files. But with this approach you can take advantage of standard input, output and error as well as how to redirect standard error to standard output and ignore the standard error output entirely with a redirectio­n.

Newspapers in English

Newspapers from Australia