mp3 to audio CD

Nix, Robert P. Nix.Robert at
Thu Dec 8 13:42:11 UTC 2005

-----Original Message-----
From: fedora-list-bounces at [mailto:fedora-list-bounces at] On Behalf Of James Wilkinson
Sent: Thursday, December 08, 2005 7:32 AM
To: For users of Fedora Core releases
Subject: Re: mp3 to audio CD

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"
------end snip---------

Another solution would be:
  wavfile=`echo $file | sed -e "s/\.mp3/.wav/g"

This works for the lamp3.mp3 example. It wouldn't work as well for lamp.mp3file.mp3 

Robert P. Nix		Mayo Foundation
RO-OC-1-13 (new loc)	200 First Street SW
507-284-0844		Rochester, MN 55905
"In theory, theory and practice are the same, but
 in practice, theory and practice are different."

More information about the fedora-list mailing list