I wrote this shellscript file. But I get error near unexpected tokendone'`
#!/bin/bash
i=1
while [ $i -lt 12 ]; do
echo Hi
i=$[$i+1]
done
Previously, there was no ; before do. I read stackexchange answers and wrote ; after while [], still I get error. I could not found the resolution online. Any ideas?
bash? If you are executing it withsh myscript, andshisn't a link tobash, your script is being run by some other shell (probablydash) which doesn't supportbash's ancient$[...]syntax.