quoted print?

Richard Brown mynamewasgone at gmail.com
Tue Nov 9 11:18:26 GMT 2004


On Tue, 9 Nov 2004 10:21:45 +0000, Julian Field
<mailscanner at ecs.soton.ac.uk> wrote:
> Any idea how to do this? My sh isn't good enough. I can redirect the stderr
> of the script to its stdout with "exec 2>&1", but how do I redirect the
> stdout through "tee" which is presumably what I need to do to get the output
> into a file as well as on the terminal. "exec |tee file.out" is obviously
> not right.

Put them together

exec 2>&1 | tee file.out

2>&1 redirects stderr to stdout, then the pipe redirects stdout, which
now also includes stderr

Regards,

Richard

------------------------ MailScanner list ------------------------
To unsubscribe, email jiscmail at jiscmail.ac.uk with the words:
'leave mailscanner' in the body of the email.
Before posting, read the MAQ (http://www.mailscanner.biz/maq/) and
the archives (http://www.jiscmail.ac.uk/lists/mailscanner.html).




More information about the MailScanner mailing list