Possible Duplicate:
Is there a way in bash to redirect output and still have it go to stdout?
How would I send /dev/stdin
to both /dev/stdout
and a $logfile
in one command?
One solution would be just to do it once for both:
cat /dev/stdin > $tempfile;
cat $tempfile > /dev/stdout;
cat $tempfile > $logfile;
But that seems bad. Is there a better way?