bug-tar
[Top][All Lists]
Advanced

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

Re: [Bug-tar] option -C ignored when it comes after the source directory


From: Eric Blake
Subject: Re: [Bug-tar] option -C ignored when it comes after the source directory
Date: Fri, 14 May 2010 16:36:17 -0600
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.9) Gecko/20100430 Fedora/3.0.4-3.fc13 Lightning/1.0b1 Mnenhy/0.8.2 Thunderbird/3.0.4

On 05/14/2010 04:30 PM, Bruno Haible wrote:
> Hi,
> 
> Seen with tar-1.23 on a glibc system:
>   $ tar cf - . -C /mnt
> has a different effect than
>   $ tar cf - -C /mnt .

Not a bug.  Tar has to consider legacy operation, when you don't use a
leading - in front of short options.

You probably want:

$ tar -cf - . -C /mnt

or:

$ tar cfC - /mnt .

> I consider this a bug for two reasons:
> 
> 1) glibc systems use GNU getopt. It allows to mix command line options with
>    regular arguments. The very idea of this feature is that
>      PROG ARGS OPTIONS
>    is equivalent to
>      PROG OPTIONS ARGS

Only when you use the dashed form of short opts, and not the legacy
dashless form.  This is documented in the tar manual.

-- 
Eric Blake   address@hidden    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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