Redirecting Standard Error

All three major shells use a greater than symbol (>) to redirect standard output. However, the Bourne Again and Z Shells' syntax to combine and redirect standard output and standard error (page 552) differs from that in the TC Shell, which uses a greater than symbol followed by an ampersand (>&). The following examples, like the bash example (page 552), reference the file x, which does not exist, and the file y, which contains a single line:

tcsh $ cat x 
cat: x: No such file or directory
tcsh $ cat y
This is y.
tcsh $ cat x y >& hold
tcsh $ cat hold
cat: x: No such file or directory
This is y.

Unlike both bash and zsh, tcsh does not provide a simple way to redirect standard error separately from standard output. A ...

Get A Practical Guide to Red Hat® Linux® 8 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.