Running shell script through JSP
843840Jan 23 2009 — edited Jan 27 2009Hi
I have shell script on my linux server .I want to create a jsp which calls the shell script .Currently i am writing JSP as
string cmd ="sh <path tp shell script>";
Runtime rt =Runtime.getRuntime();
Process p=rt.exec(cmd);
InputStream is = p.getInputStream();
p.waitFor();
I think there is nothing wrong with the concept .The script contains commands which contact the remote server like server on amazon .For running the instance of remote server command is issued and the server will give back the instance id (which takes time of 5 sec ).Based on the instance id given by remote server ,the following commands in script are executed .Now i have a confusion ,is it that commands use remote server connection did not allow the commands to execute properly or there is something wrong in my JSP code ??????
In either cases how do i make my jsp code run???
Plz reply as soon as possible