It is not the Tcl script that is faulting.
The .sh script is the one doing output to STDERR.
When you do the exec command, so somthing like
Code: Select all
if {[catch {set output [exec $binary $who]} err]} {
set output $err
}
I realy don't know what the .sh script is outputing. I only know that at one stage, it output to STDERR.
As such, if the .sh script places somthing to the STDERR channel, the Tcl will use the error message instead of the message sent to STDIN.
If you want to capture both the STDIN and STDERR messages, then replace the "set output $err" line with