1. vscript | tee -a out => tee is hanging
In June 2001 Ning Zhu posted to comp.unix.shell about a problem with
"somefunction 2>&1 | tee -a filename" hanging.
I am having a very similar problem. There was no solution posting to Ning's
I'm starting !"xterm -e myscript" (from a Xwindows menu pick)
where myscript sets some things, then runs
vscript 2>&1 | tee -a outfile
vscript is a giant vendor-supplied script that starts a GUI; vscript has an
initial interactive part, so we can't just capture all output from it (ie
use > outfile) since the user has to SEE what vscript says, & respond to it
in the xterm. One thinks | tee -a outfile is just the ticket.
"vscript" actually *does* exit, but the tee -a is hanging.
When GUI starts, one picks File -> Exit; the GUI goes away, the vscript
process goes away too, but tee -a process is hanging *and* the myscript
process *and* the xterm too.
ctrl-C in the xterm kills them all; but ungraceful + other bad sub-effects.
If run plain "vscript" from myscript (without | tee -a outfile), all works
fine: when exit GUI, the parent xterm also evaporates. But we want to log the
dratted output on that xterm!
If replace vscript with test script that echoes a few things to stdout &
stderr: in that case the tee -a does not hang, it is properly notified that
the other end of the pipe is gone, & it too exits nicely. So the concept of
vscript | tee -a outfile seems perfectly valid.
Since from "vscript 2>&1 | tee -a outfile" the vscript process really does
exit, I can only think something is not closing the pipe ok. But what/how, if
vscript & the subprocsses(GUI) it started all really do go away on their own?
Clues? Hints? Other things to try debugging it?
I found a few other somewhat related postings about slightly diff tee-related
probs so will study those.
Grateful Gal,
-----------------------------------------------------------
Ms W Lacesso, Unix Analyst, PanCdn Energy, Calgary 403.290.2740
2. My modem hangup after the negociation......
3. telnet client locks terminal when tee'd
4. LILO version 22.0 released
5. telnet 0 vs telnet `hostname` vs telnet 127.0.0.1
6. Tape Format Tool under Linux
7. unset T; echo a | tee /dev/stderr | $T; what happens?
8. umask question, please help.
9. Question: Tee Pipes
10. Qs about "tee"
11. teeing stderr
12. "tee" in the middle of a session?
13. Tee hee hee