stdout lost when a script execs another script?
- From: Paul Jansen <pj30145@xxxxxxxxx>
- Date: Tue, 30 Jan 2007 14:55:22 +0000
I have a problem where I'm trying to exec a script, and redirect its
output to a file. However, only some of the required output ends up in
the file, and some is lost. In more detail, script 'foo' execs script
'bar' as follows:
foo.tcl:
...
set status [catch {exec bar $bar_args >& $output }]
'bar' then execs two programs as follows:
bar.tcl:
...
set status [catch { eval exec $prog1 $argv >&@stdout }]
...
set status [catch {exec $prog2 $prog2_srgs >&@stdout }]
If 'bar' is run stand-alone, it operates correctly, in that the output
from *both* 'prog1' and 'prog2' appears on stdout. However, when I run
'bar' from 'foo', this doesn't work: only the stdout from *prog2*
appears in '$output'; the stdout from '$prog1' is lost.
It almost looks as if 'foo' is running 'prog1' and 'prog2' in a
pipeline, and is only saving the output from the last command in a
pipeline. Does anyone have any idea what's going on here, and how I
can fix it?
Many thanks -
/PJ
.
- Follow-Ups:
- Re: stdout lost when a script execs another script?
- From: Paul Jansen
- Re: stdout lost when a script execs another script?
- Prev by Date: Re: problem compiling on SGI/IRIX
- Next by Date: UI design for Tk app--PNG's or GIF's for icons?
- Previous by thread: problem compiling on SGI/IRIX
- Next by thread: Re: stdout lost when a script execs another script?
- Index(es):
Relevant Pages
|