-----Original Message----- From: fedora-list-bounces@redhat.com [mailto:fedora-list-bounces@redhat.com] 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" lawav.wav 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" lamp3.wav ------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
On Thu, 2005-12-08 at 07:42 -0600, Nix, Robert P. wrote:
-----Original Message----- From: fedora-list-bounces@redhat.com [mailto:fedora-list-bounces@redhat.com] 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" lawav.wav 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" lamp3.wav ------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
true, but the basename command would work for all I can think of since it only applies to the specified extension.
-- 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."
On 12/8/05, Nix, Robert P. Nix.Robert@mayo.edu wrote:
wavfile=`echo $file | sed -e "s/mp3/wav/g"`For what it's worth, $ echo lamp3.mp3 | sed -e "s/mp3/wav/g" lawav.wav 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" lamp3.wav ------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
I would like to add the following: the line
lame $file $wavfile
should be replaced with
lame "$file" "$wavfile"
so that the script works fine when there are file names like
01\ -\ Supertramp\ -\ School.mp3
Paul
Am Freitag, den 09.12.2005, 11:50 +0000 schrieb Paul Smith:
I would like to add the following: the line
lame $file $wavfile
should be replaced with
lame "$file" "$wavfile"
True.
so that the script works fine when there are file names like
01\ -\ Supertramp\ -\ School.mp3
First thing I do with /mp3s/videos/... is to convert upper letters to lower one and replace blanks in filenames with '_'.
Nautilus script folder can help a lot here.
Paul
I am sorry that my version was somehow inclomplete, but imo it's desirable _you get the script doing what is meant to accomplish, besides to use shell interpreter.
James,Robert and you _refined_ some parts which is important and should teach a little about Bash.
Thanks