aspose file tools*
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 Java 8 in Action this week in the Java 8 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: 13884
    
  10

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 7 API documentation
Scala Notes - My blog about Scala
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: qshell script execute on Java PGM
 
Similar Threads
Starting script *.sh WAS 5.
executing perl scripts from java
how to execute shell script from java program
Retrieve am Qshell's message in batch job from CL
Runtime.getRuntime().exec