#!/bin/csh -f
#syntax: challmod CODE file1 file2 ...
#CODE is a protection code like 622
set CODE = $1
shift
foreach fil ($argv)
   if ( -d $fil ) then
    echo $fil is a directory, changing protection
    /bin/chmod $CODE $fil
    $0 $CODE $fil/*
   else
    echo $fil is NOT a directory, changing protection
    /bin/chmod $CODE $fil
   endif
end
