This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan 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 EJB 3 in Action this week in the EJB and other Java EE Technologies 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
How to call Java program main method from shell script
Calling Java program from Non-Java code
ftp files to a different server
Callling a Script from a java program