Redirect stderr and not stdout? 

Newsgroups: comp.unix.shell
Date: 1997/02/06

http://groups.google.com/groups?hl=en&selm=slrn5fjq3e.5vt.pete%40sppc75.reading.ac.uk

> Is it possible to redirect stderr and not stdout?

Yes. To send stderr to file log and not stdout do

foo 2> log

where foo is your command producing output & error. Naturally this will will not work for csh-type shells.

Pete

sh - write to stderr 

*Tags*: redirect to stderr

> Simple question, how can I echo to stderr?
echo "aaa" >&2

if you have a Bourne-based shell. If you have C-shell, well, I think you're probably kinda stuck (redirecting anything other than stdout from C-shell is notoriously hard).

Chris Mattern