mp3 to audio CD

James Wilkinson fedora at
Thu Dec 8 13:32:05 UTC 2005

Thomas Springer wrote:
>     wavfile=`echo $file | sed -e "s/mp3/wav/g"`

For what it's worth,
$ echo lamp3.mp3 | sed -e "s/mp3/wav/g"
which is probably not what's required.

$ file="bright lamp3.mp3"
$ wavfile="$(basename "$file" .mp3).wav"
$ echo $wavfile
bright lamp3.wav

Still doesn't help if someone calls a file "Windows User.MP3". If that's
a problem, then you probably do want to revert to sed:
$ echo lamp3.MP3 | sed -e "s/[Mm][Pp]3$/wav/g"

Hope this helps,

E-mail address: james | Practically any car advert, for example, shows you  | that if you buy this car you will get so lost that you
                      | end up parked (well, no. The word here is "stuck") on
                      | a mountain in Monument Valley.  -- Telsa Gwynne

More information about the fedora-list mailing list