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.
__________________
|