#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2003
    Posts
    4
    Rep Power
    0

    Newbie question : execute host OS command


    Hey:
    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)
  2. #2
  3. No Profile Picture
    Clueless llama
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Feb 2001
    Location
    Lincoln, NE. USA
    Posts
    2,353
    Rep Power
    117
    Look into Runtime.getRuntime().exec(String)
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2003
    Posts
    4
    Rep Power
    0
    Can you elaborate the steps?
  6. #4
  7. No Profile Picture
    Clueless llama
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Feb 2001
    Location
    Lincoln, NE. USA
    Posts
    2,353
    Rep Power
    117
    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.


    Java tutorial
    Sun tutorials
    J2EE tutorials (go to the WEB section)
    Runtime exec
  8. #5
  9. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2003
    Posts
    4
    Rep Power
    0
    Thanks much Nemi for pointing to the resources. Yup, I am a newbie in the technologies you mentioned :-)
  10. #6
  11. No Profile Picture
    Clueless llama
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Feb 2001
    Location
    Lincoln, NE. USA
    Posts
    2,353
    Rep Power
    117
    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).
  12. #7
  13. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2003
    Posts
    4
    Rep Power
    0
    Nemi:
    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?

    thanks
  14. #8
  15. No Profile Picture
    Clueless llama
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Feb 2001
    Location
    Lincoln, NE. USA
    Posts
    2,353
    Rep Power
    117
    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.

IMN logo majestic logo threadwatch logo seochat tools logo