[PLUG] BASH string manipulation

Paul Lankow paul at lankow.net
Mon Jun 16 07:50:02 UTC 2003


I'm going to be burning a lot of music to CD from MP3 archives I've
created. In the script that I run to convert the MP3 to a wav and
normalize them, I would like to strip the title only from the filename.
Can BASH do this with the aid of SED perhaps?

>From this:

"The artist - Optional album title - Song title.mp3"

I would like to (1) strip the extension (2) Find the last " - " sequence,
and return the string from that point foreword, and (3) convert to upper
case, leaving me with:

"SONG TITLE"

Thanks in advance for your help!

Regards,
Paul

____________________________
We can not direct the wind,
But we can adjust the sails.
-Bertha Calloway





More information about the PLUG mailing list