[buug] tee command hanging
Bob Read
unixjavabob at yahoo.com
Thu Jul 25 11:56:19 PDT 2002
--- Ian Zimmerman <itz at speakeasy.org> wrote:
>
> Nick> I'm attempting to use 'tee' within a wrapper
> script to log
> Nick> stdout & stderr to a file. Specifically it
> executes the
> Nick> following:
>
> Nick> command args 2>&1 | tee <logfile>
>
Here's a workaround. I like to capture output in
variables for parsing. then pipe the output to mailx.
this avoids temporary files. so I do this all the
time:
#!/bin/sh
OUTPUT=`command args 2>&1`
echo "$OUTPUT" > logfile
echo "$OUTPUT"
=====
-----------------------------------------
Bob Read
Senior Unix Administrator/DBA/Programmer
cell (510)-703-1634
unixjavabob at yahoo.com
-----------------------------------------
__________________________________________________
Do You Yahoo!?
Yahoo! Health - Feel better, live better
http://health.yahoo.com
More information about the buug
mailing list