On Sun, 7 Apr 2002 15:53:07 -0400
Todd Slater <[EMAIL PROTECTED]> wrote:
> I can generate a playlist using: find /tunes -type f -follow -name
> '*.ogg'-o -name '*.mp3' -o -name '*.MP3' | sort > myplaylist.m3u. This
> includes all the files in all the folders in /tunes.
>
> But what if I want to generate playlists for each directory under
> /tunes? I've got /tunes/mp3-blues/albert king, /tunes/mp3-blues/freddie
> king etc...
>
> I can generate a list of directories under /tunes, but I don't know how
> to pass that on so I can do something with it. With my limited
> knowledge, I think I'll need to do a for loop (?)
After a little more digging, I managed this:
for folder in `find /tunes -type d`
do
find $folder -type f -follow -name '*.ogg' -o -name '*.mp3' -o
-name '*.MP3' | sort > $folder/playlist.m3u done
It does basically what I want it to do--generates playlists for the mp3s
and oggs in every folder and subfolder. BUT, it would be really cool if I
could get each m3u file to have a more telling name--like
talking_heads_playlist.m3u. I tried doing this with
$folder/$folder_playlist.m3u, but that $folder is the path, and I just
want the name of the current folder. (and it generated
errors--/tunes/talking_heads//tunes/talking_heads file not found)
Is it possible to pull out just the current directory (ignoring the path)
to use in the filename?
Todd (almost there)
--
Todd Slater
8:47pm up 11 days, 21:15, 2 users, load average: 0.35, 0.35, 0.28
School days, I believe, are the unhappiest in the whole span of human
existence. They are full of dull, unintelligible tasks, new and unpleasant
ordinances, and brutal violations of common sense and common decency.
(H.L. Mencken)
Want to buy your Pack or Services from MandrakeSoft?
Go to http://www.mandrakestore.com