Return value from TAR always 0 (QNX4)

I`m using TAR as part of an installation script, and need to detect if
anything went wrong during extraction.
Ive got the following bit of code in the script to detect the return value
from the TAR call :

ret=0
tar -xvf bob.tar
ret=$?
if [ ret -ne 0 ]; then
echo Failed : Returned $ret

Abort here

else
echo Passed

All OK

fi

However, no matter what happens with TAR (i.e everything extracts fine, or
there is an error) it always returns 0.
Am I looking in the wrong place for the return value? Or does it simply not
return a value?

TIA
Rich…

We don’t use tar here, however pax will read these files and will
report errors unless it comes to a bad spot, in which case it asks for
“volume 2”. The pax command equivalent to your tar would be:
pax -rvopf bob.tar
I think. look at “use pax”.

If you know the name of the last file in the archive, and you pipe
pax’s output to a place where you can compare the last file output to
what it should be, then you could do a check to see that it completed.

Richard Levy wrote:

I`m using TAR as part of an installation script, and need to detect if
anything went wrong during extraction.
Ive got the following bit of code in the script to detect the return value
from the TAR call :

ret=0
tar -xvf bob.tar
ret=$?
if [ ret -ne 0 ]; then
echo Failed : Returned $ret

Abort here

else
echo Passed

All OK

fi

However, no matter what happens with TAR (i.e everything extracts fine, or
there is an error) it always returns 0.
Am I looking in the wrong place for the return value? Or does it simply not
return a value?

TIA
Rich…