Date: Mon, 31 Oct 2005 08:02:34 -0500 From: "Fafa Hafiz Krantz" <fteg@london.com> To: questions@freebsd.org Cc: keramidas@freebsd.org Subject: mp3.sh: Asking for advice Message-ID: <20051031130235.5D5EA83C0D@ws1-1.us4.outblaze.com>
next in thread | raw e-mail | index | archive | help
Hello!
I got this script here:
#!/bin/sh
#
# Generate SFV and M3U for MP3 releases.
# $URBAN: mp3.sh,v 1.0 2005/10/24 15:05:09 fafa Exp $
#
for file in `find . -name \*.nfo | sed 's,^\./,,'`; do
directory=3D"`dirname ${file}`"
prefix=3D"`basename ${file} | sed 's/.nfo//g'`"
current=3D"`basename ${directory}`"
sfv=3D"${directory}/${prefix}.sfv"
m3u=3D"${directory}/${prefix}.m3u"
cd ${directory}
=09=09
rm -f *.sfv
rm -f *.m3u
=09=09
touch ${sfv}
if [ test `cfv -C *.mp3 > &>/dev/null` -nq 0 ]
echo "CFV returned non-zero result."
break
fi
=09=09
cat ${current}.sfv | awk '! /^;/' > ${sfv}
rm -f ${current}.sfv
=09=09
for mp3 in *.mp3;
do echo "${mp3}" >> ${m3u};
done
echo "$directory: Done"
done
In some cases though, an album contains two or more CDs -- making the files=
start
with 3 digits, and not 2 like normal -- such as cd/track: 101, 102 etc. for=
CD1 and
201, 202 etc. for CD2. If this is the case, then one .m3u (playlist) should=
be
generated for each CD, like ${prefix}-cd1.m3u, ${prefix}-cd2.m3u etc.
Now, I'm a super newbie when it comes to scripting. I have no idea what to =
do. I've
been told I can use sed, or maybe echo $filename | egrep '^[[:digit:]]{2}[^=
[:digit:]]'
but I am clueless as to how I could make that all work with my script.
If anybody has a clue, please do share it :)
Thanks you all ...
--
Fafa Hafiz Krantz
Research Designer @ http://www.bleed.com
--=20
___________________________________________________
Play 100s of games for FREE! http://games.mail.com/
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20051031130235.5D5EA83C0D>
