Subject: Re: bin/30168: NetBSD tar does not match filenames containing glob characters
To: None <gnats-bugs@netbsd.org>
From: Berndt Josef Wulf <wulf@ping.net.au>
List: netbsd-bugs
Date: 05/08/2005 06:55:31
On Sunday 08 May 2005 06:36, J.T. Conklin wrote:
> >Number:         30168
> >Category:       bin
> >Synopsis:       NetBSD tar does not match filenames containing glob
> > characters Confidential:   no
> >Severity:       serious
> >Priority:       medium
> >Responsible:    bin-bug-people
> >State:          open
> >Class:          sw-bug
> >Submitter-Id:   net
> >Arrival-Date:   Sat May 07 21:06:00 +0000 2005
> >Originator:     J.T. Conklin
> >Release:        NetBSD 3.0_BETA
> >Organization:
>
> J.T. Conklin
>
> >Environment:
>
> System: NetBSD k8 3.0_BETA NetBSD 3.0_BETA (GENERIC) #0: Mon May  2
> 02:38:27 PDT 2005 
> jtc@k8:/home/jtc/netbsd/NetBSD-3/obj-amd64/sys/arch/amd64/compile/GENERIC
> amd64 Architecture: x86_64
> Machine: amd64
>
> >Description:
>
> NetBSD tar's pattern matching doesn't seem to match filenames containing
> shell glob characters like '['.
>
> >How-To-Repeat:
>
> Suppose you wanted to extract only /bin/[ from base.tgz.  You might try:
>
>     $ tar -zxvf base.tgz ./bin/\\[
>
> (one \ is for the shell, the other to quote the [ for tar) which works
> fine with GNU tar.  But NetBSD tar returns:
>
>     tar: ustar vol 1, 3706 files, 68044800 bytes read, 0 bytes written in 1
> secs (68044800 bytes/sec) tar: WARNING! These patterns were not matched:
>     ./bin/\[
>
> (Actually, it doesn't work 100% with GNU tar, nor will it with NetBSD
> tar once this problem is resolved.  This is because ./bin/[ is a hard
> link to ./bin/test which occurs first in the archive; when it gets to
> ./bin/[ there it's already skipped the contents.  Nothing can be done
> about that...)
>
> >Fix:
> >
> >
> >Unformatted:

work find for me with a single backslash

husky: {10} which tar
/bin/tar

husky: {8} tar zcvfp test.tar.gz \[
[
tar: ustar vol 1, 1 files, 0 bytes read, 10240 bytes written in 1 secs (10240 
bytes/sec)
husky: {9} tar ztvfp test.tar.gz
-rw-r--r--  1 wulf     wheel        180 May  8 06:53 [
tar: ustar vol 1, 1 files, 10240 bytes read, 0 bytes written in 1 secs (10240 
bytes/sec)

cheerio Berndt
-- 
Every man who says frankly and fully what he thinks is doing a public service.
[Leslie Stephen]