8 Jul 2004 18:26
New Command script
I have a new script I would like to have added to the command set. It is called execcwd. It executes a command using bsh.cwd as the current working directory. See attached file. Thanks Brian
/**
Start an external application using the Java Runtime exec() method.
Display any output to the standard BeanShell output using print().
*/
bsh.help.exec = "usage: execcwd( String arg )";
execcwd( String arg )
{
this.proc = Runtime.getRuntime().exec(arg, null, bsh.cwd);
this.din = new DataInputStream( proc.getInputStream() );
while( (line=din.readLine()) != null )
print(line);
}
RSS Feed