Newbie question : execute host OS command
My Web page needs to execute UNIX shell scripts.
Can we accomplish this in Java Servlets / JSP ?
What are the steps involved? (I am new to both these technologies)
Look into Runtime.getRuntime().exec(String)
Can you elaborate the steps?
What code do you have so far? Are you saying you have never done any servlets/java and want to know how to do it from start to finish? Not to be rude, but if so, you have a lot of reading ahead. You first need to learn java, then you need to learn servlets/jsp, after that using the Runtime object to run the shell script will be nothing.
J2EE tutorials (go to the WEB section)
Thanks much Nemi for pointing to the resources. Yup, I am a newbie in the technologies you mentioned :-)
If you are simply looking for the easiest way to run shell scripts from a web server then servlets/jsp would not be what I would recommend. Servlets/jsp's are very powerful, but they have a significant ramp up time to learn. You could accomplish the same task faster and easier using perl/cgi, php or possibly server side includes (SSI).
I have been hearing about PHP and how easy it is learn and accomplish the tasks I have mentioned. Looks like Servelets/JSP is far more difficult path for me.
Can you point resources for PHP that would help me in accomplishing these tasks?
I used to do a lot of PHP, though I don't any more. The best resources I found are:
The devshed php forum (this site) - very helpful and popular.
The many tutorials on this site as well.
www.php.net - has about all you will ever need for installing and function resources.