STDERR

STDERR is another output stream beyond STDOUT, and it's like that for a good reason. You want the two data streams separated. We already covered STDOUT; it is the first. The second, STDERR, stands for standard input error. STDERR is the output stream that error messages are sent to in Unix. This is commonly the end user's terminal.

If the user is redirecting STDOUT and the program can only put errors on STDOUT, the user might never see the errors that all go into the redirected file. Instead, programs can use STDERR for errors. If the user has not redirected it, then he can still see error messages and warnings while STDOUT is headed into another file or program.

If you want to put STDERR into the same file in which you're storing STDOUT, use >& instead of > in the command; you can do so as follows:

> cat < newfile1 >& newfile2

Now that we are comfortable with the basics of standard I/O, let's take a look at how to use pipes in Unix.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.221.59.245