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
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: 14346
    
  22

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://aspose.com/file-tools
 
subject: qshell script execute on Java PGM