[Top][All Lists]
[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: |
Bruno Haible |
Subject: |
Re: [Bug-tar] option -C ignored when it comes after the source directory |
Date: |
Sat, 15 May 2010 01:00:30 +0200 |
User-agent: |
KMail/1.9.9 |
Eric Blake wrote:
> > 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.
The bug exists, whether I use the dashed form or the dashless form:
$ tar -c -v -f - . -C /mnt > /dev/null
ignores the -C option.
$ tar -c -v -f - -C /mnt . > /dev/null
correctly considers it.
> > Seen with tar-1.23 on a glibc system:
> > $ tar cf - . -C /mnt
> > has a different effect than
> > $ tar cf - -C /mnt .
> ...
> You probably want:
>
> $ tar -cf - . -C /mnt
No, I certainly don't want to use "tar -cf", for two reasons documented in the
GNU tar manual:
1) [1] says
"all tar programs, GNU and non-GNU, support old options." (that is, the
way of writing the main options without a dash).
2) [2] lists a couple of cases where the dashed options lead to surprising
behaviour.
Bruno
[1] http://www.gnu.org/software/tar/manual/html_node/Old-Options.html
[2] http://www.gnu.org/software/tar/manual/html_node/Mixing.html