Date: Mon, 26 Nov 2001 05:42:37 -0500 From: Devin Smith <devin-freebsdquestions@rintrah.org> To: freebsd-questions@freebsd.org Subject: Re: Scripting Problems please help Message-ID: <20011126054237.A19153@tharmas.rintrah.org> In-Reply-To: <15361.62448.90570.917298@guru.mired.org>; from mwm@mired.org on Mon, Nov 26, 2001 at 01:49:04AM -0600 References: <66931026@toto.iv> <15361.62448.90570.917298@guru.mired.org>
next in thread | previous in thread | raw e-mail | index | archive | help
[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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20011126054237.A19153>
