when I am doing the below operation on the shell prompt, then it works fine ::
for (( i=0 ; i<=5 ; i++ )); do echo $i; done
but when I store this loop in a file.sh and run
$sh file.sh
then it gives error as::
Syntax error: Bad for loop variable
I don't know why??, and even when I m doing ssh to my friend's shell then also it works fine.
weired isn't
for (( i=0 ; i<=5 ; i++ )); do echo $i; done
but when I store this loop in a file.sh and run
$sh file.sh
then it gives error as::
Syntax error: Bad for loop variable
I don't know why??, and even when I m doing ssh to my friend's shell then also it works fine.
weired isn't
Comment