[ale] chmod question

Fletch fletch at phydeaux.org
Mon Jun 7 13:52:39 EDT 2004


>>>>> "Dow" == Dow Hurst <dhurst at kennesaw.edu> writes:

    Dow> How come you don't have to do this: find . \( -type f \)
    Dow> -exec chmod 666 {} \;

Parens would be necessary to group conditions; they don't have
anything to do with subshells (in fact that's why they've got to be
backwhacked so the shell doesn't try and interpret them as such).
Multiple find predicates are treated as if they were joined with an
implicit -a (Boolean and operator) between them.  So when you say:

find . -name foo -print


That's really:

find . -name foo -a -print


If you wanted to get fancy and do things like "directories, or files
named fred" you'd say:

find . \( -type d -o -name fred \) -print


Or more explicitly:

find . \( -type -d -o -name fred \) -a -print


The perl find2perl utility can be helpful translating a hairy find
command line into something (possibly :) more intelligible.


-- 
Fletch                | "If you find my answers frightening,       __`'/|
fletch at phydeaux.org   |  Vincent, you should cease askin'          \ o.O'
                      |  scary questions." -- Jules                =(___)=
                      |                                               U



More information about the Ale mailing list