exec doesn't work correctly with stderr
I'm trying to execute some program:
exec -ignorestderr "bin/tecs-software-suite-2.5/JackCompiler.bat" "$current_file"
the program writes to the stderr, so tcl shows an error dialog similar to it's ordinar开发者_Python百科y errors. I don't want that, I simply want it's error output(all it's output) to be in a TK label. I added an ignorestderr but it doesnt work. (I work with activetcl 8.5.8, Windows 7)
Thanks
The magic you are looking for is 2>@1
, used like this:
# Split this up for readability...
set compiler "bin/tecs-software-suite-2.5/JackCompiler.bat"
set s [exec $compiler $current_file 2>@1]
Note that if the compiler program exits with a non-zero exit code, you'll still get an error.
精彩评论