Re: chmod -R +x for directories only



Bruce Stephens wrote:

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)"}

All of which (well - not sure how the last one is handled internally) will fail when you have a large number of matches and the resulting list is longer than the maximum length of a command line.


"xargs" comes with "find" for a good reason - to overcome this issue of maximum command line length.


-- Just because I've written it doesn't mean that either you or I have to believe it. .