public int runScript(String scriptPath, String... args)
      throws IOException, InterruptedException {
    ProcessBuilder processBuilder = getProcessBuilder(scriptPath, args);
    Process p = processBuilder.inheritIO().start();

    return waitForExitValue(p);
  }
Runs a script with IO inherited from the current Java process. Typically this redirects to console.

@param scriptPath            the path to the script file.
@param args                  the command line args to pass to the script.
@return                      the exit code returned by the script.
@throws IOException          if there was a problem running the process.
@throws InterruptedException if the thread is interrupted while waiting for the process to finish.
samza-rest/src/main/java/org/apache/samza/rest/script/ScriptRunner.java