Hi,
I am looking for help, to write a Servlet to call a Shell script on Unix which eventualy Start/Stop a component and taking status back to browser.
Thanks in Advance
Devendra
-
How to call Unix Shell Script from a Servlet? (2 messages)
- Posted by: Devendra Gupta
- Posted on: January 31 2001 11:51 EST
Threaded Messages (2)
- How to call Unix Shell Script from a Servlet? by Sudhakar k on January 31 2001 12:09 EST
- How to call Unix Shell Script from a Servlet? by Devendra Gupta on January 31 2001 15:09 EST
-
How to call Unix Shell Script from a Servlet?[ Go to top ]
- Posted by: Sudhakar k
- Posted on: January 31 2001 12:09 EST
- in response to Devendra Gupta
Check the following code stub on java.sun.com
Developer connection.
try {
// Execute command
String command = "ls";
Process child =
Runtime.getRuntime().exec(command);
// Get input stream to read from it
InputStream in = child.getInputStream();
int c;
while ((c = in.read()) != -1) {
process((char)c);
}
in.close();
} catch (IOException e) {
}
-
How to call Unix Shell Script from a Servlet?[ Go to top ]
- Posted by: Devendra Gupta
- Posted on: January 31 2001 15:09 EST
- in response to Sudhakar k
Thanks a lot!!