Subject: Re: tar verify
To: None <netbsd-users@netbsd.org>
From: Thomas Mueller <tmueller@bluegrass.net>
List: netbsd-users
Date: 12/19/2000 02:59:53
> The problem is, I am using tar in a script that is going to run on a machine 
  that cannot have any user intervention. It's for upgrading of the software on 
  a remote machine. If the tar fails, the script must restore the origonal 
  kernel and software. But how can I check that the tar failed or was 
  successfull?

Unfortunately I am rather new to shell scripts just as you are.  In a DOS .BAT
file, you could put
IF ERRORLEVEL 1 GOTO FAILED
You would have to have a line labeled
:FAILED
since FAILED has no inherent meaning in DOS.

Since the Unix shells are so much more powerful than DOS .BAT file capabilities,
there must be a good way.  Others might be able to help more than I can, or you
can read the man pages for bash, tcsh, pdksh and other shells, and look through
some of the shell scripts that come with the NetBSD installation.