Or command

I am having trouble with an Or command in my UNIX script.
It is as follows:

The run never fails even if I put one not beginning with LETT or PACK.
The holdfile is correct and putting out the right result and the dan.txt is also right stripping the first 4 characters off each file name.
Any ideas?

I would use "case" instead:

for i in `cat ${OUT_DIR}/holdfile`
do
#Check each file has the correct name begins with PACK or LETT
LETTYPE=`expr substr $i 1 4`
echo "$LETTYPE" >> dan.txt
case $LETTYPE in
LETT|PACK)
      # Do nothing.
      :;;
   *)
      # Exit.
      echo "Invalid file name, look at holdfile ($i)"
      exit 1
      ;;
   esac
done
echo "Valid file names for processing" >> ${LOGFILE}

Regards.

Thanks for that I've got it working