/** | |
Start an external application using the Java Runtime exec() method. | |
Display any output to the standard BeanShell output using print(). | |
Return the process exit code | |
*/ | |
bsh.help.execcode = "usage: execcode( String arg )"; | |
int execcode( String arg ) | |
{ | |
this.proc = Runtime.getRuntime().exec(arg); | |
this.din = new DataInputStream( proc.getInputStream() ); | |
while( (line=din.readLine()) != null ) | |
print(line); | |
return this.proc.exitValue(); | |
} |