bash - syntax of for loop in linux shell scripting -


i have problem implementing loop. error when execute script

test1.sh: 2: syntax error: bad loop variable

i don't understand error.

this script

#!/bin/bash (( c=1; c<=5; c++ )) echo "welcome $c times..." done 

can 1 tell me syntax for loop in sh(in ubuntu links dash shell) shell in ubuntu?

you run sh, not bash. try bash test1.sh, or ./test1.sh if it's executable, not sh test1.sh.


Comments

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -