
September 29th, 2000, 06:35 AM
|
|
Contributing User
|
|
Join Date: Sep 2000
Posts: 35
Time spent in forums: < 1 sec
Reputation Power: 13
|
|
|
Yes, you can do this like so (this example starts a subshell and executes a command) :
String[] command = {"/usr/bin/ksh","-c","ls"};
Process p = Runtime.getRuntime().exec(command);
BufferedReader results = new BufferedReader(new InputStreamReader(p.getInputStream()));
String nextLine = results.readLine();
while (nextLine != null) {
out.println(nextLine+"<br>");
nextLine = results.readLine();
}
You will have to put this in a try/catch block.
Success, Ton
|