This week's book giveaway is in the Big Data forum.
We're giving away four copies of Elasticsearch in Action and have Radu Gheorghe & Matthew Lee Hinman on-line!
See this thread for details.
The moose likes Linux / UNIX and the fly likes qshell script execute on Java PGM Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Elasticsearch in Action this week in the Big Data forum!
JavaRanch » Java Forums » Engineering » Linux / UNIX
Bookmark "qshell script execute on Java PGM" Watch "qshell script execute on Java PGM" New topic
Author

qshell script execute on Java PGM

Eung maeng
Ranch Hand

Joined: Feb 10, 2002
Posts: 68
Hi Guys,
Does anyone explain how to execute a qshell.sh from Java program? I know
Process process = Runtime.getRuntime().exec ....... I can use it.
I wonder whether Java program can get a return value from qshell script. if so, how.

welcome any comments with example.

cheers,
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14600
    
  24

Runtime.exec() returns a Process object, which has a method exitValue() to get the exit value of the executed process. You'll have to call waitFor() on the Process object first to wait until it has finished before calling exitValue().


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
 
I agree. Here's the link: http://kickstarter.com/rocket-mass-heater
 
subject: qshell script execute on Java PGM