/**
 * Name: Edison Chindrawaly
 * File: Execute.java
 * Desc: Execute will execute any UNIX's system command, and
 *       it will print out the result to the console screen.
 * Date: July 15, 2001
 * Vers: 1.0
 */
import java.io.*;

public class Execute
{
 public Execute(String command)
 {
  String output = new String();
  try
  {
    Process rt = Runtime.getRuntime().exec(command);
    BufferedReader ls_in = new BufferedReader(
                           new InputStreamReader(rt.getInputStream()));
    while((output = ls_in.readLine()) != null)
     System.out.println(output);
  }
  catch(Exception e)
  {
    System.out.println("error: " + e);
  }
 }

}
 

1