sebb        2003/11/27 09:07:54

  Added:       extras   execcode.bsh
  Log:
  bsh script to call exec and return the exit code
  
  Revision  Changes    Path
  1.1                  jakarta-jmeter/extras/execcode.bsh
  
  Index: execcode.bsh
  ===================================================================
  /**
        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();
  }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to