File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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

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 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.

Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 15094

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:
subject: qshell script execute on Java PGM
It's not a secret anymore!