[ale] Baffled on chmod usage

Jeff Hubbs Jhubbs at niit.com
Thu Aug 10 16:35:58 EDT 2000


Hmph!!  I had a feeling that there would be an xargs-related solution.  

Doesn't *every* problem have an xargs-related solution? ;-)

- Jeff

> -----Original Message-----
> From: byron at cc.gatech.edu [mailto:byron at cc.gatech.edu]
> Sent: Thursday, August 10, 2000 4:23 PM
> To: Jhubbs at niit.com
> Cc: ale at ale.org
> Subject: Re: [ale] Baffled on chmod usage
> 
> 
> > 
> > I want to chmod all the .exe files within and below the 
> directory "public,"
> > so I go:
> > 
> > 	# cd /<path>/public
> > 	# chmod -Rv 555 *.exe
> > 
> > but I get
> > 
> > 	chmod: *.exe: No such file or directory
> > 
> > FWIW, there are no .exe files in public, but there are many of them
> > scattered in directories underneath public.  What I especially don't
> > understand is that if I go 
> > 
> > 	# chmod -Rv 555 *
> > 
> > then everything and its brother in public and below gets 
> chmodded.  I can
> > use some other extension besides .exe that I know is 
> present but I still get
> > No such file or directory.
> > 
> > Am I misusing wildcards in bash or something?
> 
> Yes. The wildcard only selects files in the current 
> directory, not all the
> subdirectories. 
> 
> This is an instance where the recursive option of chmod and 
> bash's wildcards
> do not work together. 
> 
> find and xargs gives a fairly useful combination:
> 
> find . -name '*.exe' | xargs chmod -v 555
> 
> The find will generate names for each of the files with an 
> exe extension.
> The xargs will then execute the chmod command against every 
> file found.
> 
> BAJ
> 
--
To unsubscribe: mail majordomo at ale.org with "unsubscribe ale" in message body.





More information about the Ale mailing list