SurferTim wrote: ↑Mon Sep 04, 2017 3:22 pm
Correct use of for in a terminal.
Code: Select all
for((i=0;i<12;i++)); do echo "Test $i"; done;
Not if you're globbing filenames like the OP wanted to do. Apart from the sudo error, they had the syntax correct:
Code: Select all
for i in 04*; do avconv -i "$i" -s:v hd480 -acodec mp3 "$i-480"; done
In bash, you can do your range example with the shorter, simpler:
Code: Select all
for i in {0..11}; do echo "Test $i"; done
It also accepts alpha ranges like {a..m}, and does what you'd expect.
‘Remember the Golden Rule of Selling: “Do not resort to violence.”’ — McGlashan.
Pronouns: he/him