Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #15422

Re: Wrong command option in the manual examples

From Robert Elz <kre@munnari.OZ.AU>
Newsgroups gnu.bash.bug
Subject Re: Wrong command option in the manual examples
Date 2019-09-24 12:28 +0700
Message-ID <mailman.958.1569302944.2190.bug-bash@gnu.org> (permalink)
References (3 earlier) <CAD0rTC6EHd5w5A6kuD850mLzu+V_EJXQyoZ=amQcF9TktTSEJA@mail.gmail.com> <38052651-6d67-6107-660c-707ca39ee00c@case.edu> <23726.1569247367@jinx.noi.kre.to> <16758.1569259485@jinx.noi.kre.to> <14125.1569302882@jinx.noi.kre.to>

Show all headers | View raw


    Date:        Mon, 23 Sep 2019 14:12:27 -0400
    From:        Chet Ramey <chet.ramey@case.edu>
    Message-ID:  <49989bf9-7c12-2670-de3f-20feead50a63@case.edu>

  | It's in SVR2 (1984?), at least,

Thanks.

  | The SVR2 page implies that it was added to support cpio.

Yes .. the function of the option is fine - when used while making the
archive the files get listed (and therefore added) first, and the directory
that contains them after all the files, which means that when extracted
the files can be written to their directory before the directory's permissions
are seen and set, perhaps denying writing.

What's wrong with it is making what is a global option act like it is an
expression primitive.   If it worked as an expression operator, you should
be able to do
	find . -name foo -depth -o -name bar -nodepth ...
but you can't, aside from there being no "nodepth" or anything equivalent,
the -depth option is set for the whole traversal, before the first
directory is read, it doesn't only turn on when the primitive is executed.

Find at the time had no options, so where they should have just
added one (or three) they instead did that "make it an operator" solution.

kre

Back to gnu.bash.bug | Previous | Next | Find similar | Unroll thread


Thread

Re: Wrong command option in the manual examples Robert Elz <kre@munnari.OZ.AU> - 2019-09-24 12:28 +0700

csiph-web