home *** CD-ROM | disk | FTP | other *** search
/ PC World 2007 June / PCWorld_2007-06_cd.bin / multimedia / ppsee / PPSeeSetup.exe / lib / bsh-commands-2.0b4.jar / bsh / commands / exec.bsh < prev    next >
Text File  |  2005-05-23  |  373b  |  15 lines

  1. /**
  2.     Start an external application using the Java Runtime exec() method.
  3.     Display any output to the standard BeanShell output using print().
  4. */
  5.  
  6. bsh.help.exec = "usage: exec( String arg )";
  7.  
  8. exec( String arg ) 
  9. {
  10.     this.proc = Runtime.getRuntime().exec(arg);
  11.     this.din = new DataInputStream( proc.getInputStream() );
  12.     while( (line=din.readLine()) != null )
  13.         print(line);
  14. }
  15.