Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Return Values

Status
Not open for further replies.

jestrada101

Technical User
Mar 28, 2003
332
I have a java program that I run and it is to return a -100 value.

After I've run the program, i type "print $?" and expect the -100, but I get 255?
 
Is there other code executing after the Java program?

If so the printing of the $? will show you the exit code of the last command executed.

I hope this helps.

Steve
 
There is no other code after the java program executes.
Right after it finishes, i type "print $?" and it returns 255 instead of -100, which I'm supposed to get.

Thanks
JE
 
Capture the return value of your java program, you
are gettig the shell return value which is to be
expected.
 
Program exit status values are (or were at least) restricted to being small positive integers (0..255).

If you try and return something outside that range, then my guess is that something else happens.

Try returning say +100 instead and see whether that makes it into $? OK.

--
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top