Subject: Re: Returning status from 'tar'
To: None <stuartb@cat.co.za, netbsd-help@netbsd.org>
From: Paul Sander <paul@wakawaka.com>
List: netbsd-help
Date: 02/07/2000 20:01:07
Many of the standard Unix utilities, particularly older ones, fail to
indicate problems through their exit status.  Invoking "find" and redirecting
its output to file in a full filesystem, for example, produces incorrect
results in an undetectable way.  You might be up the creek on this one.

This would seem to be a good project to add to the list:  Audit the
utilities and give them meaningful exit status codes.

--- Forwarded mail from stuartb@cat.co.za

In a shell script I am writing I need to be able to read the return value
from the tar command. The shell script is executing in the Bourne shell and
I have always been able to get the return status as follows ...

rm some_file
return=$?
echo ${return}

However with the tar command it always seems to return 0, whether it
succeeds or not. I have experimented with piping the output of the tar
through grep to detect errors but is there some easier way of doing things?
Am I missing something simple?

--- End of forwarded message from stuartb@cat.co.za