1

Bash filename prefix replacement

view story
linux-howto

http://stackoverflow.com – I've read around, but I can't seem to wrap my head around this. I'm converting ripped files I made in flac to mp3 for a mp3 player. This set is from two CDs though, so their number prefix is undesirable. Some filename examples: 01 Foo 9.flac 02 Foo 10.flac 03 Foo 11.flac 04 Foo 12.flac 05 Foo 13.flac 25 Foo 1.flac 26 Foo 2.flac ... Here's what I have so far $for file in *Foo*.flac; do flac -cd "$file" | lame -q 0 -V0 - "/media/mp3player/speech/${file%.flac}.mp3"; done How can I go about removing the number and space prefix, and ideally replace it with what corresponds to the ending numb (HowTos)