Hi All,
I am trying a wierd combination of using shell scripts to run jobs on server. I need some parameters to be passed to scripts from HTML form, I am trying to use servlets for this. Can one advice how to pass parameters to shell script using servelts ans HTML form.
Thank you,
Ashish
-
servlets and shell scripts (5 messages)
- Posted by: Ashish Kasangottuwar
- Posted on: June 01 2001 14:20 EDT
Threaded Messages (5)
- servlets and shell scripts by Easwar Thondikulam on June 01 2001 15:10 EDT
- servlets and shell scripts by Andy Nguyen on June 01 2001 15:19 EDT
- servlets and shell scripts by Ashish Kasangottuwar on June 04 2001 18:55 EDT
- servlets and shell scripts by Aditya Anand on June 04 2001 17:11 EDT
- servlets and shell scripts by Ashish Kasangottuwar on June 04 2001 18:57 EDT
-
servlets and shell scripts[ Go to top ]
- Posted by: Easwar Thondikulam
- Posted on: June 01 2001 15:10 EDT
- in response to Ashish Kasangottuwar
Ashish,
If you are using Oracle as a Database, it is possible to do what you want by making the Servlet invoke an External Proc which in turn can kick off a Shell script.
If you are not Using Oracle then sorry for this answer.
-
servlets and shell scripts[ Go to top ]
- Posted by: Andy Nguyen
- Posted on: June 01 2001 15:19 EDT
- in response to Ashish Kasangottuwar
It shouldn't be too hard. You'll have to fork a process with Runtime.getRuntime().exec(...). Read your params from the request, build your command-line, and feed it to Runtime.exec().
Andy -
servlets and shell scripts[ Go to top ]
- Posted by: Ashish Kasangottuwar
- Posted on: June 04 2001 18:55 EDT
- in response to Andy Nguyen
Thanks Andy,
Reading parameters from request is clear and so is for the script to read command line parameter. Can you please elaborate on how to build a command line.
Thanks
Ashish
-
servlets and shell scripts[ Go to top ]
- Posted by: Aditya Anand
- Posted on: June 04 2001 17:11 EDT
- in response to Ashish Kasangottuwar
just a comment to compliment this... pass parameters as an array of strings... rather than a complete string, the first element is the actual command followed by the arguments... its faster that way....so Runtime.getRuntime().exec(cmdArray); -
servlets and shell scripts[ Go to top ]
- Posted by: Ashish Kasangottuwar
- Posted on: June 04 2001 18:57 EDT
- in response to Aditya Anand
Thanks Aditya for the comment.
Can you giude me where can I get additional related details?
-ashish
ashish@sgi.com