bug-bash
[Top][All Lists]
Advanced

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

Re: Wrong command option in the manual examples


From: Robert Elz
Subject: Re: Wrong command option in the manual examples
Date: Tue, 24 Sep 2019 12:28:02 +0700

    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




reply via email to

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