home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 April / CMCD0404.ISO / Software / Shareware / Comunicatii / advwebrank / awr.msi / disk1.cab / bsh_1.2b6.jar / bsh / commands / exec.bsh < prev    next >
Encoding:
Text File  |  2002-05-26  |  362 b   |  14 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.     proc = Runtime.getRuntime().exec(arg);
  10.     din = new DataInputStream( proc.getInputStream() );
  11.     while( (line=din.readLine()) != null )
  12.         print(line);
  13. }
  14.