urgent: script problem???

#!/usr/bin/sh
read file
#exec 3<&0
exec 0<$file
while read line
do
if [ $count -eq 4 ]
then
BOUND=$line
break
fi
count=`expr $count + 1`
done
#exec 0<&3
echo $BOUND

sh check.sh

myfile.txt

after runing the script i am getting following error messages
check.sh[7]: test: 0403-004 Specify a parameter with this command.
expr: 0402-050 Syntax error.
check.sh[7]: test: 0403-004 Specify a parameter with this command.
expr: 0402-050 Syntax error.

#!/usr/bin/sh
read file
#exec 3<&0
exec 0<$file
while read line
do
        if [[ $count -eq 4 ]]
        then
                BOUND=$line
                break
        fi
        count=`expr $count + 1`
done
#exec 0<&3
echo $BOUND

Still syntax errors.

could you please try running the script on your machine.

myfile.txt has following

1
2
3
4
5
6

Intialize count to zero before while loop

skyineyes,

You are repeatedly breaking the rules by bumping up your posts. See your original thread - error line? and this locked thread - http://www.unix.com/shell-programming-and-scripting-q-and-a/39945-problem.html

Please adhere to the rules. You are very close to earning a ban.