Check status code (e.g. - System.exit(1) ) in Unix

Do you have any idea how to check the Java status code returned from System.exit(int status) in Unix?

In DOS I was able to write this:

java -jar FilePreparation.jar
if not %errorlevel% == 0 goto file_prep_err

But I can't find anything equivalent for Unix?
Who is Participating?
wide_awakeConnect With a Mentor Commented:
for example, put this into ""
java -jar FilePreparation.jar
echo $?
in bash you can use $? to get the exit status of the previous command.

All Courses

From novice to tech pro — start learning today.