If I execute this bash script:
#!/bin/bash j=0 for(( i=1;i<(j);i++ )) do echo j done
./test: line 6: syntax error near unexpected token `newline' ./test: line 6: `done'
I know that the problem are the extra parenthesis at
(j), but I would like to understand why it detects the error at line 6, not 3. What is the logic here?