I'm trying to write a script that will vol up radio in the background
#!/bin/sh
for (( i = 80 ; i <= 101; i++ ))
do
amixer cset numid=1 i$% sleep 60;
done
But i have problem:
alarmclock-vol.sh: 3: alarmclock-vol.sh: Syntax error: Bad for loop variable

for (( … ))is not available in sh.shmay or may not bebash; on some systems,/bin/shis a symlink to/bin/bash, and the above script may work. In any case, you certainly shouldn't assume that it is.shis a symlink tobash, bash behaves differently when invoked as sh (posix mode enabled). Therefore, even when sh is bash, "sh is not bash" still applies./bin/shis a symlink to/bin/bash, and thefor (( ... ))syntax works in a script with#!/bin/sh; with#!/bin/dashit gives me"Syntax error: Bad for loop variable". (It's bash 4.1.5 if that matters.)for ((...))in this case), some acts a little differently (thesourceand.builtins), while some syntax is disabled outright (like process substitution<(...)and>(...)). Those are just examples that came to mind right now.