While Loops

I'm trying to create a loop that will prompt the user for 15 values, not forcing them to enter all 15. If the user enters through one or more of the prompts the null value needs to be converted to 0, otherwise set the parameter = to the value entered:

ex.
Please enter file no #1: 17920
Please enter file No #2: 11100
Please enter file No #3:
....
Please enter file No #15:

I will then be taking these values and passing all 15 values onto another script or program.

Here's what I have so far:

counter=1
while [ $counter -gt 0 -a $counter -lt 16 ]
do
if [ $counter -gt 0 ] ; then
echo " File No #$counter: \c"
read file_no
case $file_no$counter in
'') file_no_$counter=`echo 0`;;
*) file_no_$counter=`echo $file_no$counter`;;
esac
fi
counter=`expr $counter + 1`
done

Please read the forum rules:

Please do not disregard this question, it is for work.

I'll take your word that this is for work. But I'm not sure of what you exactly want. Nor do I know what shell you're using. You are using stuff present in the old bourne shell so I'll stick with that and take a guess at what you want:

counter=1
while [ $counter -gt 0 -a $counter -lt 16 ] ; do
        echo " File No #$counter: \c"
        read file_no
        if [ "$file_no" = "" ] ; then
                file_no=0
        fi
        eval file_no_$counter=$file_no
        counter=`expr $counter + 1`
done


echo file_no_1 = $file_no_1
echo file_no_2 = $file_no_2
echo file_no_3 = $file_no_3
echo file_no_4 = $file_no_4
echo file_no_5 = $file_no_5
echo file_no_6 = $file_no_6
echo file_no_7 = $file_no_7
echo file_no_8 = $file_no_8
echo file_no_9 = $file_no_9
echo file_no_10 = $file_no_10
echo file_no_11 = $file_no_11
echo file_no_12 = $file_no_12
echo file_no_13 = $file_no_13
echo file_no_14 = $file_no_14
echo file_no_15 = $file_no_15

Works exactly like I need it to to pass the values onto a Cobol program.
Thanks