RE: exit value

I am running HP-UX & ksh

I have several validation programs that scan log files for error messages.

One of these files scan 3 diff files, thus I have the exit value in a variable and depending on which log-file I am scanning the value changes.
I am not getting the value I expect but a different value ( echo $? displays 213 - expect -777).
So my question is: Can you exit with a variable instead of a fixed value?

    exit $xerr  \(where xerr=-777\)
       vs.
    exit -777          

THX in advance. :slight_smile:

The exit value should be larger than what can be represented in eight bits: 0-127 signed or 0-255 unsigned.
Stick with numbers like 101, 102, 103

This is because unix wait strips all but the lowest eight bits from the return code before passing it to "$?"