bug-tar
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-tar] Wildcard in combination of "-C" option


From: Live user
Subject: Re: [Bug-tar] Wildcard in combination of "-C" option
Date: Sat, 10 Nov 2012 12:33:09 +0100
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:16.0) Gecko/20121026 Thunderbird/16.0.2

On 10/11/2012 12:18, Sergey Poznyakoff wrote:
Alex Antener <address@hidden> ha escrit:

I don't know if this is worth a bug report, but it looks like GNU tar
does not accept wildcards in combination of the -C option.

Wildcards are expanded by shell, not by tar.  Tar reats all its
non-optional arguments as file names.  When you call it like this:

tar -C ~/foobar -czf foobar.tar.gz *.sql

the shell tries to find files matching *.sql and replaces it with
their names.  Since there are no matching files in the cwd, it leaves
the argument as is and then invokes tar.

Regards,
Sergey




Try this:

tar -C  ~/foobar -cvf archive.tar `ls ~/foobar | grep '.sql$'`



reply via email to

[Prev in Thread] Current Thread [Next in Thread]