Re: [tcljava-user] exec question
Brought to you by:
mdejong
|
From: Mo D. <md...@cy...> - 2001-06-24 23:13:34
|
On Sat, 23 Jun 2001, Tam Huynh wrote:
> How do i go about getting the return value from executing the exec command
> in jacl? I have try the following in the tclsh which work but doesn't work
> in my java program..
>
> shell:
> catch {exec tclsh83 script.tcl} s
> puts $s
>
>
> java:
> Interp interp = new Interp();
> String testing = "set res [exec tclsh83 D:/Tcl83/bin/scripts/script.tcl]";
> interp.eval(testing);
> interp.eval("puts $res");
Well, that should work. Here are the results I get with Jacl 1.3
from the CVS.
$ make shell
% set res [catch {exec false} s]
1
% set res
1
% set s
child process exited abnormally
% set res [catch {exec echo hi} s]
0
% set s
hi
Perhaps the fact that you left the catch out is raising
a TclException and your Java code fails to catch it.
Mo DeJong
Red Hat Inc
|