From owner-freebsd-questions Mon Nov 26 2:42:23 2001 Delivered-To: freebsd-questions@freebsd.org Received: from tharmas.rintrah.org (dhcp065-024-235-184.insight.rr.com [65.24.235.184]) by hub.freebsd.org (Postfix) with SMTP id C8C9B37B417 for ; Mon, 26 Nov 2001 02:42:20 -0800 (PST) Received: (qmail 19166 invoked by uid 1000); 26 Nov 2001 10:42:37 -0000 Date: Mon, 26 Nov 2001 05:42:37 -0500 From: Devin Smith To: freebsd-questions@freebsd.org Subject: Re: Scripting Problems please help Message-ID: <20011126054237.A19153@tharmas.rintrah.org> Mail-Followup-To: freebsd-questions@freebsd.org References: <66931026@toto.iv> <15361.62448.90570.917298@guru.mired.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <15361.62448.90570.917298@guru.mired.org>; from mwm@mired.org on Mon, Nov 26, 2001 at 01:49:04AM -0600 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG [snip] > > What I woudl like to do is have a script search each of the directories = > > for mp3 files and dump that output into a .m3u (playlist file) in it. = > > for example.. > > #!/bin/sh > find . -type d -print | > while read x > do > (cd "$x"; ls *.mp3 > "$x.m3u") > done Might I suggest the following small changes, assuming you want *all* the mp3 files listed in one playlist. #!/bin/sh find . -type d -print | while read x do (cd "$x"; ls | grep -i mp3 >> "~/playlist.m3u") done which also has the advantage of listing files which end in uppercase or mixed case, i.e. song.MP3 or song.Mp3. --devin To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message