I'm writing a Bash script. When I run it, I get a syntax error I don't understand.
Here my script:
#!/bin/bash
i=1
while [ $i -le "6" ]
do
j=1
i=`expr $i +1`
echo \
while [ $j -le "$i" ]
do
echo $i
j=`expr $j+1`
done
done
echo \enter code here
Here the error:
./test.sh: line 9: syntax error near unexpected token `do'
./test.sh: line 9: `do'
What am I doing wrong?
echoreally there? If so, you should remove it because it escapes the linebreak.