bug-tar
[Top][All Lists]
Advanced

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

Re: [Bug-tar] Re: tar has strange command line argument parsing


From: Joerg Schilling
Subject: Re: [Bug-tar] Re: tar has strange command line argument parsing
Date: Tue, 08 Nov 2005 11:53:36 +0100
User-agent: nail 11.2 8/15/04

Martin Michlmayr <address@hidden> wrote:

> * Paul Eggert <address@hidden> [2005-11-04 10:56]:
> > The POSIX guidelines say that options like -b and -f that take
> > arguments can be spelled either like this, with a space before
> > the option-arguments:
> >    tar -cvb 20 -f x.tar file1 file2
> > 
> > or like this, without a space:
> >    tar -tvb20 -fx.tar file1 file2
>
> > Also, POSIX says the operand to an option can begin with "-".  For
> > example,
> > 
> > I hope this helps to explain the behavior you observed.
>
> Thanks a lot for this explanation.  I understand the behaviour of tar
> now.  I also agree it makes sense to follow POSIX, even though I
> personally think it's weird that POSIX would allow for something like
> "-tvb20".

I would relly be interested to know the place where POSIX allows
something like:

        xxx -tvb20

>From my understanding, this makes no sense and is creating problems
in case someone did make a typo. It also looks contradictionary
to the idea to force people to use --longopt to distinguish between
a set of boolean singlecharacterflags and a long option.

What should this be:

        tar -tvbf20

Just think that it could also mean to set the blocksize to 2 and the
archive to /dev/rmt/0 after ignoring the 'f' letter.

Note: The traditional UNIX tar allows "tar c3 ." to selecet tape
entry '3' from a precompiled list or a list found in /etc/default/tar.


Check http://cvs.opensolaris.org/source/xref/on/usr/src/cmd/tar/
to verify.....

I believe that some of the problems in GNU tar are caused by the
idiosyncratic option parser that is used by GNU tar. My last tests
(done 1-2 years ago) did verify that GNU tar does not folow the 
tar interface description in SUSv2.

If you have problems with the GNU tar command line syntax, I would
be intersted to get your opinion for the CLI from star.

ftp://ftp.berlios.de/pub/star/alpha/

Note that you need to call star as "tar" (e.g. by calling
/opt/schily/bin/tar) to get the SUSv2 compatible interface that
tries to be close to what a traditional tar implementation
asumes.



Jörg

-- 
 EMail:address@hidden (home) Jörg Schilling D-13353 Berlin
       address@hidden           (uni)  
       address@hidden   (work) Blog: http://schily.blogspot.com/
 URL:  http://cdrecord.berlios.de/old/private/ ftp://ftp.berlios.de/pub/schily




reply via email to

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