[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Bug-tar] Wildcard in combination of "-C" option
From: |
Alex Antener |
Subject: |
Re: [Bug-tar] Wildcard in combination of "-C" option |
Date: |
Sat, 10 Nov 2012 18:09:32 +0100 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
... which means, that the command
> tar -C ~/foobar -czf foobar.tar.gz ~/foobar/*.sql
works. - But then, - again, - the folder is included into the archive, which I
try to avoid.
Do I really have to
> cd ~/foobar
before tar-ing the archive? I thought the option -C is meant to be used to
exclude the folder path in the archive.
On Sat, Nov 10, 2012 at 01:18:50PM +0200, 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
signature.asc
Description: Digital signature