You're checking to see if 20 files named using the form, "BARE01_DLY_MKT_yyyymmdd" (where "MKT" is variable between all 20 files). How would passing one file name to the script help? Unless you mean to pass the date to the script so that it checks for that date? That is, today's date is 20060720, but you want to check for 20 files with the date 20060719...?
check20.sh 20060803:
Code:
#!/bin/ksh
mydate=$1
integer filecount=0
for file in BARE01_DLY_???_$mydate; do
filecount=$filecount+1
done
if (( $filecount == 20 )); then
exit 0
else
exit 1
fi
Note that there is no error checking here. You can feed anything you want as the date.