z/OS UNIX System Services User's Guide
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


Redirecting error output to a file

z/OS UNIX System Services User's Guide
SA23-2279-00

You can redirect error output from the workstation screen to a file, using 2>. (As you remember, 2 is the file descriptor for stderr.) For example:
sort -u filea 2>errfile
sorts filea, checking for unique output records. Any messages regarding duplicate records are redirected to a file named errfile.

If you want to append error output to an existing file, use 2>>.

If you do not care about seeing the error output, you can redirect it to /dev/null (also known as the bit bucket). This is equivalent to discarding the error messages.
sort -u filea 2>/dev/null

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014