From owner-freebsd-questions@FreeBSD.ORG Fri Oct 28 11:24:15 2005 Return-Path: X-Original-To: questions@freebsd.org Delivered-To: freebsd-questions@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 459DF16A41F for ; Fri, 28 Oct 2005 11:24:15 +0000 (GMT) (envelope-from fteg@london.com) Received: from webmail-outgoing.us4.outblaze.com (webmail-outgoing.us4.outblaze.com [205.158.62.67]) by mx1.FreeBSD.org (Postfix) with ESMTP id AAF8A43D46 for ; Fri, 28 Oct 2005 11:24:14 +0000 (GMT) (envelope-from fteg@london.com) Received: from unknown (unknown [192.168.9.180]) by webmail-outgoing.us4.outblaze.com (Postfix) with QMQP id 76E2E18001D7 for ; Fri, 28 Oct 2005 11:24:14 +0000 (GMT) X-OB-Received: from unknown (205.158.62.49) by wfilter.us4.outblaze.com; 28 Oct 2005 11:24:14 -0000 Received: by ws1-1.us4.outblaze.com (Postfix, from userid 1001) id C680383C07; Fri, 28 Oct 2005 11:24:13 +0000 (GMT) Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="iso-8859-1" MIME-Version: 1.0 From: "Fafa Hafiz Krantz" To: "Will Maier" , freebsd-questions@freebsd.org Date: Fri, 28 Oct 2005 06:24:13 -0500 Received: from [213.187.181.70] by ws1-1.us4.outblaze.com with http for fteg@london.com; Fri, 28 Oct 2005 06:24:13 -0500 X-Originating-Ip: 213.187.181.70 X-Originating-Server: ws1-1.us4.outblaze.com Message-Id: <20051028112413.C680383C07@ws1-1.us4.outblaze.com> Cc: questions@freebsd.org, Fafa Hafiz Krantz Subject: Re: Maintaining my music collection (off topic) X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Oct 2005 11:24:15 -0000 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=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} 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" To: freebsd-questions@freebsd.org Subject: Re: Maintaining my music collection (off topic) Date: Wed, 26 Oct 2005 14:47:39 -0500 >=20 > 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). >=20 > FreeBSD sh (1) supports parameter expansion, including expansions used > in the referenced function. >=20 > -- >=20 > o--------------------------{ Will Maier }--------------------------o > | jabber:..wcmaier@jabber.ccc.de | email:..........wcmaier@ml1.net | > | \.........wcmaier@cae.wisc.edu | \..........wcmaier@cae.wisc.edu | > *------------------[ BSD Unix: Live Free or Die ]------------------* -- Fafa Hafiz Krantz Research Designer @ http://www.bleed.com --=20 ___________________________________________________ Play 100s of games for FREE! http://games.mail.com/