Subject: Returning status from 'tar'
To: NetBSD-Help <netbsd-help@netbsd.org>
From: Stuart Brooks <stuartb@cat.co.za>
List: netbsd-help
Date: 02/08/2000 10:01:29
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?

Thanks for the help

Stuart Brooks