unary operator is missing

hi ,
i m getting an error unary operator is missing. pls check why is this so?

 i=5
while test $i !=0
do
echo $i
i=`expr $i - 1`
done

You are missing a space:

while test $i != 0
                ^

Indention is a good thing when writing code.

you're missing a space:

 i=5
while test $i != 0    #need space here
do
echo $i
i=`expr $i - 1`
done

GOT ITTTTTT :smiley: