Error to "find" a matching array element in a directory

Hi,
I have defined an array which holds a couple of elements which are nothing but files names. I want to find the files in a directory for the matching file name(array elements) with less than 1 day old.
When I am trying to execute the code (as below), it gives an error.

Your help in this regard is solicited.

#!/bin/ksh
#########################################################################
# Mainline Section #************************************************************************
# Name: dailyjobcheck.ksh
#************************************************************************
RETCD="Return-Code= 0"
DATADIR=/usr1/MKB333/test
BPRDDIR=/app301/MKBTEST611/BPRD; export BPRDDIR
set -A bprdArr tibpsext tibjelvj tibjechk tibjevt2 wmsbxtvx tibapepr.log cisbworm
cntB=0
echo "Job ran on `date +"%m/%d/%Y"` " >>$DATADIR/test
echo "Statistics: \n" >>$DATADIR/test

while [ $cntB -le ${#bprdArr[@]} ]
do
FILE=`find $BPRDDIR -type f -mtime -1 -name "`echo ${bprdArr[cntB]}`*"`
if [ -f $FILE ];
then
RC=`awk '/Return-Code= 0/ { print $5,$6 }' | $FILE`
if [ "$RC" = "$RETCD" ]
then
echo "`echo ${bprdArr[cntB]}` ran OK on `date | cut -c1-3`day" >>$DATADIR/test
else
echo "`echo ${bprdArr[cntB]}` Abend \n" >>$DATADIR/test
fi
else
echo "`echo ${bprdArr[cntB]}` did not run on `date | cut -c1-3`day" >>$DATADIR/test
fi
cntB=`expr $cntB + 1`
done

ERROR

dailyjobcheck.ksh[41]: dailyjobcheck.ksh: cannot execute
find: The -name option requires filename argument.
dailyjobcheck.ksh[41]: tibpsext: not found
dailyjobcheck.ksh[42]: test: arg
ument expected


Regards,
Ketan

You probably mean

FILE=`find $BPRDDIR -type f -mtime -1 -name "${bprdArr[$cntB]}*"`

... with the missing dollar sign for the subscript, and the silly echo in backticks removed.

The code seems to assume there is only a single matching file.

Why don't you simply do

for base in ibpsext tibjelvj tibjechk tibjevt2 wmsbxtvx tibapepr.log cisbworm; do
  ...

seeing as you don't seem to be using the numeric index for anything explicitly?