[Gllug] Extracting substrings in bash script

Dylan dylan at dylan.me.uk
Tue Nov 6 12:03:00 UTC 2007


Hi all,

I'm writing a script to re-organise a pile of mp3 files. Basically, I need to 
distribute them through an alphabetical directory tree. In a terminal, I get:

dylan at hal:~> tagmp3 show test.mp3
Test.mp3
    Artist : The Streets
    Title  : It Was Supposed to Be So Easy
    Album  : A Grand Don't Come for Free
    Track  : 1
    Year   : 2004
    Genre  : Other
    Comment:

But when I try:

t=`tagmp3 show test.mp3`
echo $t

I get:

Test.mp3 Artist : The Streets Title : It Was Supposed to Be So Easy Album : A 
Grand Don't Come for Free Track : 1 Year : 2004 Genre : Other Comment:

So, what are the many and various possibilities for extracting the Artist, 
Title, Album and Track from that string?

Thanks
Dylan
-- 
"The blizzard was alone on Earth and knew no equal."
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug




More information about the GLLUG mailing list