From owner-freebsd-questions@FreeBSD.ORG Fri Jan 13 21:37:08 2006 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 1F22216A41F for ; Fri, 13 Jan 2006 21:37:08 +0000 (GMT) (envelope-from nomadlogic@gmail.com) Received: from zproxy.gmail.com (zproxy.gmail.com [64.233.162.206]) by mx1.FreeBSD.org (Postfix) with ESMTP id A7A6E43D46 for ; Fri, 13 Jan 2006 21:37:03 +0000 (GMT) (envelope-from nomadlogic@gmail.com) Received: by zproxy.gmail.com with SMTP id l1so660203nzf for ; Fri, 13 Jan 2006 13:37:03 -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:content-transfer-encoding:content-disposition:references; b=NL3b33R0lEZS/90QjUiA3RcWYVGPO0H4g2ULGt7tm5JB21eiDa8cJGI1eaMXNk69/0ip8QUuA3aga0Ztd9aozk/87cyzUBYzTObUboeEpPjhzmCeikrCYA+kJKk4ge5jwTq1QLau6x8fJ86lvPai9TLncy2upzA35glrEoY5zDQ= Received: by 10.36.67.12 with SMTP id p12mr2997692nza; Fri, 13 Jan 2006 13:37:02 -0800 (PST) Received: by 10.36.2.1 with HTTP; Fri, 13 Jan 2006 13:37:02 -0800 (PST) Message-ID: <57d710000601131337i4c275c45w5f8d3efd1d433313@mail.gmail.com> Date: Fri, 13 Jan 2006 13:37:02 -0800 From: pete wright To: Kristian Vaaf In-Reply-To: <66915a1d4f35.43c829eb@broadpark.no> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <66915a1d4f35.43c829eb@broadpark.no> Cc: questions@freebsd.org Subject: Re: Script to lock the state of my MP3 files 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, 13 Jan 2006 21:37:08 -0000 On 1/13/06, Kristian Vaaf wrote: > > Hello! > > I use this script to generate simple verification files (SFV) and MP3 pla= ylist files (M3U) > based on the info file (NFO) that I create for every album that I digital= ize. > > If this is an album: > > ./dj_antoine-arabian_adventure-sessp010-vinyl-2005: > 00-dj_antoine-arabian_adventure-sessp010-vinyl-2005.nfo > 00-dj_antoine-arabian_adventure-sessp010-vinyl-2005-cover.jpg > a1-dj_antoine-arabian_adventure_2-original_mix.mp3 > b1-dj_antoine-arabian_adventure_2-chriss_ortega_and_thomas_gold_vocal_mix= .mp3 > b2-dj_antoine-arabian_adventure_2-chriss_ortega_and_thomas_gold_dub_mix.m= p3 > > Then the script makes it into: > > ./dj_antoine-arabian_adventure-sessp010-vinyl-2005: > 00-dj_antoine-arabian_adventure-sessp010-vinyl-2005.m3u > 00-dj_antoine-arabian_adventure-sessp010-vinyl-2005.nfo > 00-dj_antoine-arabian_adventure-sessp010-vinyl-2005.sfv > 00-dj_antoine-arabian_adventure-sessp010-vinyl-2005-cover.jpg > a1-dj_antoine-arabian_adventure_2-original_mix.mp3 > b1-dj_antoine-arabian_adventure_2-chriss_ortega_and_thomas_gold_vocal_mix= .mp3 > b2-dj_antoine-arabian_adventure_2-chriss_ortega_and_thomas_gold_dub_mix.m= p3 > > My script is made for regular sh though. > If it were to be bashed -- how would it look like? should be the same syntax for sh and bash as bash is a decendant of sh. i would keep the #! line /bin/sh as this will make the script more portable. -pete > > #!/bin/sh > # > # Generate SFV and M3U files for MP3 albums. > # $URBAN: mp3_archive.sh,v 1.0 2005/10/24 15:09:05 vaaf Exp $ > # > > for file in `find $(pwd) -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 -Cq *.mp3 > cat ${current}.sfv | awk '! /^;/' > ${sfv} > rm -f ${current}.sfv > > for mp3 in *.mp3; do echo "${mp3}" >> ${m3u}; done > > echo "$current: Done" > > done > > Thanks guys, > Kristian > > > _______________________________________________ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.o= rg" > -- ~~o0OO0o~~ Pete Wright www.nycbug.org NYC's *BSD User Group