I'll ask again, how do you do that in a shell script?  And remember
   that it has to run on every flavor of Unix in the world, not just
   Linux or Solaris, so no cheating and using other than the most generic
   commands and options :-).

I believe this is quite portable:

        dd bs=1 skip=257 count=5 if=/dev/tape of=/some/tmp/file
        if test `cat /some/tmp/file` = ustar ; then
          : This is a tar file.
        fi

Ben

Reply via email to