From owner-freebsd-questions@FreeBSD.ORG Mon Oct 31 10:25:43 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 98B6E16A41F for ; Mon, 31 Oct 2005 10:25:43 +0000 (GMT) (envelope-from larsen.nick@gmail.com) Received: from xproxy.gmail.com (xproxy.gmail.com [66.249.82.202]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1312243D5D for ; Mon, 31 Oct 2005 10:25:39 +0000 (GMT) (envelope-from larsen.nick@gmail.com) Received: by xproxy.gmail.com with SMTP id i28so9638wxd for ; Mon, 31 Oct 2005 02:25:39 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=PwDfI2IZsmwEkSRk6dBcG74Hs12ezwyTmSYfHPDmkoDylEj5KGZIeY/N89lW3qjfZ0B7zwRGk+T4cvG1R25FCqaErH98XZXoDg+vgt/I/WdnGZC5XyVWU/N6woonrr97+h+OUJceEFayBgctOSzx9bh7VX2mXTo/XBOIA2ekNuo= Received: by 10.70.37.7 with SMTP id k7mr1587863wxk; Mon, 31 Oct 2005 02:01:01 -0800 (PST) Received: by 10.70.82.16 with HTTP; Mon, 31 Oct 2005 02:01:00 -0800 (PST) Message-ID: Date: Mon, 31 Oct 2005 23:01:00 +1300 From: Nick Larsen To: Fafa Hafiz Krantz In-Reply-To: <20051028112413.C680383C07@ws1-1.us4.outblaze.com> MIME-Version: 1.0 References: <20051028112413.C680383C07@ws1-1.us4.outblaze.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: Will Maier , questions@freebsd.org, freebsd-questions@freebsd.org 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: Mon, 31 Oct 2005 10:25:43 -0000 Just for shell scripters' information: the line in the script: PREFIX=3D"`basename ${file} | sed 's/.nfo//g'`" could be replaced with the simpler: PREFIX=3D"`basename ${file} .nfo`" basename can remove whatever you give as $2 On 10/29/05, Fafa Hafiz Krantz wrote: > > > 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 > > > > > 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@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 > > > -- > ___________________________________________________ > Play 100s of games for FREE! http://games.mail.com/ > > _______________________________________________ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to " > freebsd-questions-unsubscribe@freebsd.org" >