You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jmeter-dev@jakarta.apache.org by se...@apache.org on 2003/11/27 18:07:54 UTC

cvs commit: jakarta-jmeter/extras execcode.bsh

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: jmeter-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-dev-help@jakarta.apache.org