Re: chmod -R +x for directories only
- From: Bruce Stephens <bruce+usenet@xxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 30 Aug 2005 17:17:56 +0100
Buzzbomb <buzzbomb@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> writes:
[...]
> Its not the find thats the problem, its the whitespace in the
> results returned which is then being interpreted as field separators
> by the shell.
Well, that is the problem with find, or rather xargs (which doesn't
seem to have a way to separate arguments by newline, which seems odd;
that seems like a useful kind of option to have). Hence the GNU
extensions of -print0 and -0.
> a command line like
>
> # find . -type d -exec chmod 711 {} \;
>
> will work fine as the results of the find are passed directly to chmod
> without going through the shell.
Yep, that'll do. Or, in zsh:
chmod 711 **/*(/)
or
for i in **/*(/)
chmod 711 $i
or
for i in ${(f)"$(find . -type d)"}
chmod 711 $i
or, if you have a file produced by "find . -type d > directories" you can do things
like
chmod 711 ${(f)"$(<directories)"}
Probably "find . -type d -print0 | xargs -0 ..." is easiest to
remember, though.
.
- Follow-Ups:
- Re: chmod -R +x for directories only
- From: usenet
- Re: chmod -R +x for directories only
- From: Big and Blue
- Re: chmod -R +x for directories only
- From: Buzzbomb
- Re: chmod -R +x for directories only
- References:
- chmod -R +x for directories only
- From: billy
- Re: chmod -R +x for directories only
- From: billy
- Re: chmod -R +x for directories only
- From: Keith Matthews
- Re: chmod -R +x for directories only
- From: Buzzbomb
- chmod -R +x for directories only
- Prev by Date: Re: Throttling network interface traffic
- Next by Date: Re: chmod -R +x for directories only
- Previous by thread: Re: chmod -R +x for directories only
- Next by thread: Re: chmod -R +x for directories only
- Index(es):
Relevant Pages
|