Advanced shell scripting question :-)

Steven W. Orr steveo at syslang.net
Wed Sep 4 18:00:55 EDT 2002


I have a program (which we shall call p) which produces text to both 
stdout and stderr.

I want the following three things to happen when I run p:

1. I want both stdout and stderr to go to the screen

2. I want stdout and stderr combined in a file

3. I want an error log file to only contain stderr.

p 2>&1 | tee outnerr # Solves 1 and 2

p 2> errlog	# Solves 3 but breaks 1 and 2

p 2> errlog | tee out # Solves 3 but also breaks 1 and 2.

Any takers?

-- 
-Time flies like the wind. Fruit flies like a banana. Stranger things have -
-happened but none stranger than this. Does your driver's license say Organ
-Donor?Black holes are where God divided by zero. Listen to me! We are all-
-individuals! What if this weren't a hypothetical question? steveo at syslang.net




More information about the gnhlug-discuss mailing list