Type conditional chmod 

Newsgroups: comp.unix.shell
> changed on a Solaris 7 box. All executables need one set ie 775,
> directories another (possibly the same), and regular data files another
> ie 644.

Directories are easy enough.

find /dir -type d -exec chmod 755 {} \;

For files, you could do something like

for file in `find /dir -type f`
do
    if file $file | grep "script" >/dev/null 2>&1
    then
          chmod 775 $file
    else
          chmod 644 $file
    fi
done

This is dependant on what you include in your definition of scripts. If you have perl or other such scripts, you might want to expand the grep, eg:

file $file | egrep "script|perl|python"

"Peter Sundstrom"

Type conditional chmod 

If it's just 644 vs 755, then it's easy:

chmod -R a+rX <dir>

(add read for everybody and execute for everybody only when already at elast one execute bit is set)

execute only if the file is a directory or already has execute permission for some user (X)

Casper