stdout lost when a script execs another script?



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
.



Relevant Pages

  • Re: KB905915 Problems with Search Companion
    ... script. ... //Display The AOL Search Bar ... var win = external.menuArguments; ... how to make a popup search window. ...
    (microsoft.public.windows.inetexplorer.ie6.browser)
  • Re: ie6 script error
    ... Otherwise you could install a script debugger and then get it to interpret ... of the page by activating Prompt for Active Scripting. ... WE window choose View, ... Maximize your IE window so you maximize the size of your Status bar. ...
    (microsoft.public.windows.inetexplorer.ie6.browser)
  • Re: lost show desktop icon
    ... Running the script doesn't put it on the Quick Launch bBar. ... Show Desktop.scf to the Quick Launch Bar. ... >>> desktop icon and its file association. ...
    (microsoft.public.windowsxp.general)
  • Re: message to MenuBar
    ... script calls SendKeysor some functions of enable32.dll (which I ... Since I have used a third party to implement dockable ... menu bar, CMenu is removed by the third party and instead of menu it ... Any idea how to make the script work in the third party implementaion ...
    (microsoft.public.vc.mfc)
  • Re: removing a IE title bar
    ... In those cases you have a little more control over what ... Then from script, call your program, ... Does anyone know of a way to make the title bar not visible, ... from losing the window which subsequently causes problems. ...
    (microsoft.public.scripting.vbscript)