• Post Reply Bookmark Topic Watch Topic
  • New Topic

Calling a script on Linux from a JSP or servlet  RSS feed

 
Howard Ralston
Ranch Hand
Posts: 105
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Howdy folks,
I originally posted this in the JSP forum, but there was no response. Hopefully this is the correct place to ask.
I am trying to find a way to call a shell script (probably bash) on the server while passing a parameter. In this case the parameter will be a username. The script will perform a check to see if the username is available and return a response to the JSP
(or servlet if necessary). Can anyone give me
a snippet of code to get me started?
Thanks,
Howard
 
James O'Dell
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Take a look at Runtime.exec(string[] cmdarray).
--Jim
 
Howard Ralston
Ranch Hand
Posts: 105
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks James. I will try it out.
Howard
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!