[talk] Recursive chmod problem

Jonathan Drews jondrews at fastmail.com
Thu Dec 2 22:28:23 EST 2021


On Thu, Dec 02, 2021 at 10:18:05PM -0500, ori at eigenstate.org wrote:
> I'm confused. Why do you think that he's
> wrong?
> 
> The shell expands the list of filenames.
> The programs never see the globs.
> 
> Unless you happen to name your directory
> 'mydir.jpg', the expansion of the glob
> never contains a directory, so it never
> gets passed to the program.
> 
> It's that simple.
> 
> 	myprogram *.jpg
> 
> is the same as typing out a list of every
> jpg in the current directory:
> 
> 	myprogram a.jpg b.jpg c.jpg ...
> 
> there's precisely zero difference.
> 

Thanks for the input and sorry for being so dense. This works:

chmod -R 664 */*.html

I was under the presumption that the -R flag obviated the need for
explicit glob expansions. That is 
$ chmod -R 660 *.pdf would be smart enough to traverse directories.
At least that is what his book shows.

__
Kind regards,
Jonathan




More information about the talk mailing list