delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2002/02/26/10:32:17

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Message-ID: <3C7BAA09.AAF5D88B@hack.kampbjorn.com>
Date: Tue, 26 Feb 2002 16:30:17 +0100
From: Hack =?iso-8859-1?Q?Kampbj=F8rn?= <cygwin AT hack DOT kampbjorn DOT com>
Reply-To: cygwin AT cygwin DOT com
X-Mailer: Mozilla 4.79 [en] (Windows NT 5.0; U)
X-Accept-Language: en,da,es,ca
MIME-Version: 1.0
To: Eugene Rosenzweig <eugenius AT dingoblue DOT net DOT au>
CC: cygwin AT cygwin DOT com
Subject: Re: tar -f behaviour
References: <0c6501c1bed4$f548d5e0$0300a8c0 AT bluebox>
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id g1QFWFX15551

Eugene Rosenzweig wrote:
> 
> Looking at tar I noticed a small oddity in its behaviour, as compared to
> what I would have thought was 'normal'
> When dealing with files, using dash before options, the 'f' option has to be
> the last one in the option string, e.g.
> tar -tfz tarball.tar.gz
You meant "tar tfz ..." right?

> works while
> tar -ftz tarball.tar.gz
> doesn't reporting that file 'tz' does not exist.
> It seems that 'f' anything after the 'f' option is considered to be the
> archive filename.
> tar -f tarball.tar.gz -tz
> works.
> When dash is absent the oddity is absent too,
> tar ftz tarball.tar.gz
> works with options f, t and z in any combination whatsoever.
> 
> There is no tar manpage on my system. I looked at 'tar --help' for option
> explanation which didn't offer anything and I compared with linux tar
> behaviour. The linux version doesn't exhibit any pickiness about position of
> 'f' option when dash is being used. I do not have any experience with unix
> command line parsing but I wonder if the presence of this behaviour only
> when there is a dash indicates it has got something to do with getopt() or
> popt? I do not seem to have manpage for getopt() either even though it is
> references in popt manpage.
> 
> In conclusion, is this a bug or a feature?

This is a feature and documented in the info page. GNU doesn't believe
in man so they provide all their documentation in the info format, and
some programs also have a minimal man page. Look for old options style
(without dash):
   When options that need arguments are given together with the command,
   all the associated arguments follow, in the same order as the
options.
   Thus, the example given previously could also be written in the old
   style as follows:

        $ tar cvbf 20 /dev/rmt0

   Here, `20' is the argument of `-b' and `/dev/rmt0' is the argument of
   `-f'.

Note to have info find the tar.info file automatically you may need to
'redir' the info files. Something like this will do. That the tar
package doesn't install the info page can be considered a bug 8-(
	cd /usr/info
	for f in *.info ; do install-info $f dir ; done

> 
> PS I checked the package listing on http://cygwin.com, there is no man page
> with tar distribution. There is tar.texi in the source package. Maybe there
> should be manpage in the binary package.
> 
> --
> Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
> Bug reporting:         http://cygwin.com/bugs.html
> Documentation:         http://cygwin.com/docs.html
> FAQ:                   http://cygwin.com/faq/

-- 
Med venlig hilsen / Kind regards

Hack Kampbjørn

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019