#!/bin/csh -f

# Return the number of plain files in the directory $1 if that
# directory exists (exit status 0); 0 if the directory does not exist
# (exit status 1).

if (-d $1) then
  ls -l $1 | tail -n +2 | \grep -v '^d' | wc -l
  exit
endif
echo 0
exit(1)
