View Single Post
Old 09-26-2002, 09:07 AM  
salsbury
Confirmed User
 
Join Date: Feb 2002
Location: Seattle
Posts: 1,070
to summarize, keep this in mind.

your shell is what does the wildcard expansion. so when you type:

chmod -R 755 *.cgi

your shell expands *.cgi to a list of the files in the current directory that end with .cgi . this would also include directories (which are basically files) that happened to be named something.cgi . only after the expansion is done are the arguments actually sent to chmod.

some shells will error out if there are no .cgi files. other shells (better shells) wil just pass '*.cgi' on to the chmod binary. chmod doesn't understand wildcards (most binaries don't, find is an exception) so it would try to change the permissions on a file called '*.cgi'. if that file was a directory it would change them recursively.

fuqalot's post is correct. i'm just clarifying why this happens.
__________________
salsbury is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote