#! /bin/sh
# Fgrids grid_file_template    
# determine if FERRET grid files matching template are currently on-line
# by searching the paths in FER_GRIDS

if [ $# -ne 1 ]; then
   echo "usage: Fgrids grid_file_template"
   exit
fi

found=0
for subdir in ${FER_GRIDS} ; do
   filelist=`cd "${subdir}" ; find * -maxdepth 0 -type f -name \*"$1"\* -print`
   if [ -n "${filelist}" ]; then
      echo "* * * * * * * * in ${subdir}"
      ( cd ${subdir} ; /bin/ls -l ${filelist} )
      echo " " 
      found=1
   fi
done

if [ ${found} -eq 0 ]; then
   echo "No files matching $1 were found"
fi

