This is the mail archive of the
mailing list for the Cygwin project.
Re: tar -f behaviour
- From: Hack Kampbjørn <cygwin at hack dot kampbjorn dot com>
- To: Eugene Rosenzweig <eugenius at dingoblue dot net dot au>
- Cc: cygwin at cygwin dot com
- Date: Tue, 26 Feb 2002 16:30:17 +0100
- Subject: Re: tar -f behaviour
- References: <0c6501c1bed4$f548d5e0$0300a8c0@bluebox>
- Reply-to: cygwin at cygwin dot com
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
> 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
When options that need arguments are given together with the command,
all the associated arguments follow, in the same order as the
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
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-(
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
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html