#!/bin/tcsh 

# script that scans the whole directory and checks if the entry is a directory or a file
# note the use of the backquote to invoke the command dir

echo 'start script files'

foreach file ( `dir` )
 
  echo "$file is a " 
  if (-d $file) then
    cd $file
    echo "  directory with content: " `dir`
    cd ..
  else if (-e $file) echo "  file" 
  endif
end

echo 'end script files' 
