Maintaining my music collection (off topic)

Fafa Hafiz Krantz fteg at london.com
Fri Oct 28 04:24:15 PDT 2005


Here's what I ended up with:

#!/bin/sh
#
#   Generate SFV and M3U for all releases.
#   $URBAN: mp3.sh,v 1.0 2005/10/24 15:05:09 fafa Exp $
#

for file in `find /home/mp3 -name \*.nfo`; do

	DIRECTORY="`dirname ${file}`"
	PREFIX="`basename ${file} | sed 's/.nfo//g'`"
	CURRENT="`basename ${DIRECTORY}`"
	SFV="${DIRECTORY}/${PREFIX}.sfv"
	M3U="${DIRECTORY}/${PREFIX}.m3u"

	cd ${DIRECTORY}
	rm -f *.sfv
	rm -f *.m3u
	touch ${SFV}
	cfv -C *.mp3
	cat ${CURRENT}.sfv | awk '! /^;/' > ${SFV}
	rm -f ${CURRENT}.sfv

	for mp3 in `find * -name \*.mp3 -maxdepth 1`; do
		echo "${mp3}" >> ${M3U}
	done

done

:)

----- Original Message -----
From: "Will Maier" <willmaier at ml1.net>
To: freebsd-questions at freebsd.org
Subject: Re: Maintaining my music collection (off topic)
Date: Wed, 26 Oct 2005 14:47:39 -0500

> 
> On Wed, Oct 26, 2005 at 06:39:48AM -0400, Parv wrote:
> > Looks like this script is not going to work in FreeBSD /bin/sh.
> > Install one of shells/bash* (guessing) ports and run this script
> > under that shell (unless somebody does the conversion for you).
> 
> FreeBSD sh (1) supports parameter expansion, including expansions used
> in the referenced function.
> 
> --
> 
> o--------------------------{ Will Maier }--------------------------o
> | jabber:..wcmaier at jabber.ccc.de | email:..........wcmaier at ml1.net |
> | \.........wcmaier at cae.wisc.edu | \..........wcmaier at cae.wisc.edu |
> *------------------[ BSD Unix: Live Free or Die ]------------------*



--
Fafa Hafiz Krantz
  Research Designer @ http://www.bleed.com


-- 
___________________________________________________
Play 100s of games for FREE! http://games.mail.com/



More information about the freebsd-questions mailing list