This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Java in General and the fly likes how to call shell script(interactive) from java code Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "how to call shell script(interactive) from java code" Watch "how to call shell script(interactive) from java code" New topic
Author

how to call shell script(interactive) from java code

ritesh padhe
Greenhorn

Joined: Aug 03, 2010
Posts: 8
Hello,

I want to call shell script from java code. Once shell script is executed it will ask for the confirmation from user(yes or no) and after getting value from user it will proceed.
Any pointers?

Thanks in advance.
Tim Moores
Rancher

Joined: Sep 21, 2011
Posts: 2408
java.lang.ProcessBuilder
Saral Saxena
Ranch Hand

Joined: Apr 22, 2011
Posts: 202

Tim Moores wrote:java.lang.ProcessBuilder


Hi Tim,

Can you please show it with a small example that will make understanding more clearer ...thanks in advance...!!
Tim Moores
Rancher

Joined: Sep 21, 2011
Posts: 2408
Just google for "running a script using processbuilder" or some such phrase.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to call shell script(interactive) from java code
 
Similar Threads
jsp control problem
Calling Java program from Non-Java code
Callling a Script from a java program
How to call Java program main method from shell script
ftp files to a different server