I am using ksh
dummpy_file does not exist . Finding the exit status of tar
SUSE10 / tar version GNU 1.15.1
>gunzip -d dummpy_file | tar xvf -
gunzip : dummpy_file: No such file or directory
>echo $?
>0
SUSE11 / tar version GNU 1.20
>gunzip -d dummpy_file | tar xvf -
gunzip : dummpy_file No such file or directory
tar : This does not look tar archive
tar: Error exit delayed from previous errors
>echo $?
>2
Is the difference in behavior due the different tar versions ? Please help
Yes,
tar1.19 fixed the following bug:When the
gunzipprogram at the start of pipeline can’t find the file it’s supposed to unpack, it exits and emits 0 bytes to its stdout. The oldtarversion behaved as if 0 bytes were a correct tar archive, hence no error message.