Summary: background a process: how to catch its output (error, standard out, etc)?

From: Zaigui Wang (zaigui@yahoo.com)
Date: Thu Dec 05 2002 - 15:20:33 EST


Thanks for the quick replies from:
Steve Maher
David Foster
Darren Dunham
William J. Bochnik

All of you guy provided the information that I wanted.
My initial confusion came from the fact that I tried
to catch the output after the "&", such as:
tar xvf a_tar_file & > /tmp/log 2>&1

of course it did not work for me. The correct way of
doing this is:

tar xvf a_tar_file > /tmp/log 2>&1 &

As far as recording the PID is concerned, $! seems to
be the easiest way to go. I like Steve's way of
handling this:

scriptone.sh > /var/scriptone.$!.txt 2>&1 &

Zaigui
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers



This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 23:25:25 EDT