Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

tar exit code 2?

2,265 views
Skip to first unread message

mca...@caplin.com

unread,
Jun 27, 1997, 3:00:00 AM6/27/97
to mca...@caplin.com

tar cvf /dev/rmt0 /[directory]
.
.
echo $?
2

No errors are reported.
The tape can be read back and all the files are there and appear to be in
order.

Question: What does the error status code of 2 mean.

Thanks in advance.

-------------------==== Posted via Deja News ====-----------------------
http://www.dejanews.com/ Search, Read, Post to Usenet

Craig Miller

unread,
Jun 27, 1997, 3:00:00 AM6/27/97
to

mca...@caplin.com wrote:
>
> tar cvf /dev/rmt0 /[directory]
> .
> .
> echo $?
> 2
>
> No errors are reported.
> The tape can be read back and all the files are there and appear to be in
> order.
>
> Question: What does the error status code of 2 mean.
>
> Thanks in advance.

I don't know tar's source, but I went and looked, and
an exit code of 2 apparently means "non-fatal error".

At least in AIX4.2, it doesn't look like it could exit
with 2 w/o giving an error: there's always an error
just above a statement that sets the exit code to 2.

>
> -------------------==== Posted via Deja News ====-----------------------
> http://www.dejanews.com/ Search, Read, Post to Usenet

--
Craig Miller .... Cedar Park, TX .... programmer, homebrewer
I do not speak for anyone besides myself.
Remove the .nospam to contact me.

Kevin Brand

unread,
Jun 28, 1997, 3:00:00 AM6/28/97
to

exit code 2 as defined in /usr/include/sys/errno.h:

no such file or directory

you have probably given a list of files to tar, where one or more has been
deleted, or otherwise doesn't exist. Tar continues its work if other files
in the list exist.

-Kevin

Craig Miller <d...@zilker.net> wrote in article
<33B3BAEF...@zilker.net>...

Craig Miller

unread,
Jun 28, 1997, 3:00:00 AM6/28/97
to

Kevin Brand wrote:
>
> exit code 2 as defined in /usr/include/sys/errno.h:
>
> no such file or directory
>
> you have probably given a list of files to tar, where one or more has been
> deleted, or otherwise doesn't exist. Tar continues its work if other files
> in the list exist.
>


... Except that AIX's tar does not exit with errno.

errno.h very rarely defines exit codes for programs. It's
strictly for errno values when system calls fail.

There are a few programs that do exit with errno, but AIX's
tar isn't one of them.

Craig

> -Kevin

0 new messages