#! /bin/csh #scan directory recursively, this program name is ex6.csh switch ($#argv) case 0: set dir=. breaksw case 1: set dir=$argv[1] breaksw endsw echo .... scanning directory $dir cd $dir foreach i (*) if ( -d $dir/$i) then $0 $dir/$i else ls -l $i echo -n type any command: set command = $< eval $command endif end