![]() |
bad for loop variable [solved]
hello, busybox 'for' command is not working as it does on common distributions.
it says: line 1: syntax error: Bad for loop variable is there a special way to work with for variables in maemo?? my script run well on ubuntu the for scripts is: formpl: for ((i=1;i<=$1;i++)) do mpl mp3 $i;donempl command works well ;) thanks |
Re: bad for loop variable
This is not a bourne shell construct. If you want to use bash, install the bash package.
Or try something like for i in `seq 1 7` ; do ... |
Re: bad for loop variable
Backticks are obsolete, and problematic when nested. Modern Bourne shells, BusyBox included, undestand $()-notation.
Code:
for i in $(seq $n); do mpl mp3 $i;done Code:
i=1 |
Re: bad for loop variable
A solution::
#cat loop.sh for ((i=1; i<=5; i++)) do echo "welcome $i times" done # chmod 777 loop.sh #./loop.sh |
All times are GMT. The time now is 06:40. |
vBulletin® Version 3.8.8