Search the FAQ Archives

3 - A - B - C - D - E - F - G - H - I - J - K - L - M
N - O - P - Q - R - S - T - U - V - W - X - Y - Z
faqs.org - Internet FAQ Archives

Unix - Frequently Asked Questions (2/7) [Frequent posting]
Section - How do I redirect stdout and stderr separately in csh?

( Part1 - Part2 - Part3 - Part4 - Part5 - Part6 - Part7 - Single Page )
[ Usenet FAQs | Web FAQs | Documents | RFC Index | Business Photos and Profiles ]


Top Document: Unix - Frequently Asked Questions (2/7) [Frequent posting]
Previous Document: How do I ... and have that change affect my current shell?
Next Document: How do I tell inside .cshrc if I'm a login shell?
See reader questions & answers on this topic! - Help others by sharing your knowledge
Date: Mon, 26 Oct 1992 20:15:00 -0500

2.9)  How do I redirect stdout and stderr separately in csh?

      In csh, you can redirect stdout with ">", or stdout and stderr
      together with ">&" but there is no direct way to redirect stderr
      only.  The best you can do is

        ( command >stdout_file ) >&stderr_file

      which runs "command" in a subshell;  stdout is redirected inside
      the subshell to stdout_file, and both stdout and stderr from the
      subshell are redirected to stderr_file, but by this point stdout
      has already been redirected so only stderr actually winds up in
      stderr_file.

      If what you want is to avoid redirecting stdout at all, let sh
      do it for you.

        sh -c 'command 2>stderr_file'

User Contributions:

Comment about this article, ask questions, or add new information about this topic:

CAPTCHA




Top Document: Unix - Frequently Asked Questions (2/7) [Frequent posting]
Previous Document: How do I ... and have that change affect my current shell?
Next Document: How do I tell inside .cshrc if I'm a login shell?

Part1 - Part2 - Part3 - Part4 - Part5 - Part6 - Part7 - Single Page

[ Usenet FAQs | Web FAQs | Documents | RFC Index ]

Send corrections/additions to the FAQ Maintainer:
tmatimar@isgtec.com (Ted Timar)





Last Update March 27 2014 @ 02:12 PM