// This appears in Core Web Programming from
// Prentice Hall Publishers, and may be freely used
// or adapted. 1997 Marty Hall, hall@apl.jhu.edu.

/** A test of the Exec class. */

public class ExecTest {
  public static void main(String[] args) {
    // Note: no trailing "&" -- special shell chars
    // not understood, since no shell started.
    // Besides, exec doesn't wait, so the program
    // continues along even before Netscape pops up.
    Exec.exec("/usr/local/bin/netscape");

    // Run commands, printing results
    Exec.execPrint("/usr/bin/ls");
    Exec.execPrint("/usr/bin/cat Test.java");

    // Don't print results, but wait until done
    // before continuing on.
    Exec.execWait("/usr/local/JDK/bin/javac Test.java");

    // There should be Test.class there now
    Exec.execPrint("/usr/bin/ls");
  }
}

