I have tried to make this script to generate:
000
001
002
...
997
998
999
i=0
while [ $i -le 999 ]
do
if [ $i le 9 ]
then
echo "00"$i
else if [ $i -gt 9 ] && [ $i -le 99 ]
then
echo "0"$i
else
echo $i
fi
i=`expr $i + 1`
done
test:
~$ ./echonum
./echonum: line 14: syntax error near unexpected token `done'
./echonum: line 14: `done'
What is the problem with this?