tgeer43
January 14th, 2010, 09:39 PM
I've been using a very simple snippet of code for many months now without incident. Today it starts giving an error every time.
Here's the code:
for a in *.mp3
do
b="${a:5}"
mv "$a" "$b"
doneThis should strip the first five characters from each mp3 file name in the current working directory. It's always worked before but now gives a 'Bad Substitution' error on line #3.
I though it might have something to do with the fact that I've moved to 9.10 since I last used it, like some obscure missing package or something. So I booted back in to 9.04 but got the same result.
I just know it's going to turn out to be something stupid but I'm really scratching my head at the moment.
Someone want to save me from a brain aneurysm? ;)
tgeer
Here's the code:
for a in *.mp3
do
b="${a:5}"
mv "$a" "$b"
doneThis should strip the first five characters from each mp3 file name in the current working directory. It's always worked before but now gives a 'Bad Substitution' error on line #3.
I though it might have something to do with the fact that I've moved to 9.10 since I last used it, like some obscure missing package or something. So I booted back in to 9.04 but got the same result.
I just know it's going to turn out to be something stupid but I'm really scratching my head at the moment.
Someone want to save me from a brain aneurysm? ;)
tgeer