tar: extract with wildcards missleading

Bug #365021 reported by mrq1
4
Affects Status Importance Assigned to Milestone
tar (Ubuntu)
New
Undecided
Unassigned

Bug Description

the extracting of multiple files from a tar file doesnt work as
expected:

$ touch a{a,b,c,d} b{a,b}

wildcard adding of files is ok:

$ tar cfa test.tar.bz2 a* b*
$ rm a* b*

$ tar xfa test.tar.bz2 "b*"
tar: Pattern matching characters used in file names. Please,
tar: use --wildcards to enable pattern matching, or --no-wildcards to
tar: suppress this warning.
tar: b*: Not found in archive
tar: Error exit delayed from previous errors

it looks like i need the "--wildcards" option for doing this

$ tar --wildcards xfa test.tar.bz2 "b*"
tar: You must specify one of the `-Acdtrux' options
Try `tar --help' or `tar --usage' for more information.

but this is not true

$ tar --wildcards -xfa test.tar.bz2 "b*"
tar: a: Cannot open: No such file or directory
tar: Error is not recoverable: exiting now

$ tar --wildcards -xa test.tar.bz2 "b*"

simply hangs and does nothing :(

expected behavior:
$ tar xfa test.tar.bz2 "b*"
ba
bb

like any other file-archiving program

if this is not tar compliant, there should be at least an
--extractasexpected option to enable this feature!

Revision history for this message
Morpheus (morpheus17.pro) wrote :

On Ubuntu 9.04, it works using this method:

tar -xf file.tar --wildcards "*a"

However, according to man page of tar, --wildcards are enabled by default:

--wildcards
    use wildcards when excluding files (the default)

It also doesn't works with -X, you must type --exclude "*b"

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.