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
Post a Comment