Re: bsdtar vs gnutar

From: Tim Kientzle <kientzle_at_freebsd.org>
Date: Tue, 07 Sep 2004 22:35:13 -0700
Vladimir Grebenschikov wrote:
> 
> GNU tar has ability to show detailed info on extract in case when more
> then one 'v' letter specified like:
> 
> $ gtar -xvvzf arch.tar.gz
> -rwxrwxr-x ivan/ivan       268 Sep  6 16:40 2004 install
> $ tar -xvvzf arch.tar.gz
> x install

I'll look into this.  Probably won't make it into 5.3, though.

> Another problem, gnu tar output -v output while extracting on stdout,
> but BSD tar output this on stderr ("tar -xvzf arch.tar.gz | head -n1" no
> longer work)

Not always.  ;-)  Sometimes gnutar outputs to stderr,
sometimes to stdout.  POSIX.1-1997 clearly specifies
stderr.  (Yet another place where gtar ignores the POSIX
standards... ;-/

I suggest you try
     tar -xvzf arch.tar.gz |& head -n1
or
     tar -xvzf arch.tar.gz 2>&1 | head -n1

which will work correctly with either gtar or
bsdtar.

Cheers,

Tim Kientzle
Received on Wed Sep 08 2004 - 03:35:14 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:11 UTC