Operating System - HP-UX
1755830 Members
4426 Online
108838 Solutions
New Discussion

Java application. exitValue() of a HP-UX Script

 
Jes·s
Occasional Contributor

Java application. exitValue() of a HP-UX Script

I'am writing a Java aplication that will be executed under several plataforms and which make programs to execute.

I use a Process objet....

Process child=Runtime.getRuntime().exec(path);

...I do a waitFor() and then I get the exit value in an int variable whith exitValue() method.

This work well with executable files.

But I need to execute Unix scripts (HP-UX) and get the exit value.
At the last line of the scripts I write the instruction exit n (where n is an integer number), but the exitValue I get is always 255.

Could anyone help me?. How can I get the exit Value of a Unix Script?
JGNoguer
1 REPLY 1
Andreas Voss
Honored Contributor

Re: Java application. exitValue() of a HP-UX Script

Hi,

just an idea:
put at the first line:
#!/sbin/sh
and replace at the end exit 32 with:
return 32

Don't know if this works but give it a try.

Regards

Andrew