On Tue, 23 Jan 2001, Ben Elliston wrote:

>    > 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
> 
>    But wait...  You just threw away the first 257 bytes from stdin. Now
>    what are you going to put into stdout for tar to read?
> 
> Err, rewind to the beginning of the file? ;-)

It's a pipe.  Can you rewind that?  In /bin/sh ?

-Mitch


Reply via email to