Monday, September 22, 2008

Running Unix Commands from java

Runtime rtime = Runtime.getRuntime();
Process child = rtime.exec(new String[] {"/bin/sh","-c","sh myScript.sh"});
child.waitFor();
int return_code = child.exitValue();

No comments:

Post a Comment