#!/usr/local/bin/bash # UPDATED BY : operat0r support sed 's/ /%20/g' to remove spaces and replace them with %20 # http://rmccurdy.no-ip.com/ # Greg Oldendick # m3u_script # Sept 1, 2002 # warning, this script uses rm -f =) # # This script creates playlist.m3u files for each subdirectory containing mp3 # files. It uses recursion, which probably explains the relatively slow speed. # (i.e. bash recursion isn't the greatest =) # Note it does not work on .MP3 files, only .mp3. This is intentional. #recursive function go_deeper() { for file in * # for each file (and subdirectory) in the current directory do if [ -d "$file" ] # if $file is a directory then cd "$file" echo `pwd` # print rm -f playlist.m3u # if we already have a playlist file, rm it go_deeper cd .. else if [ `echo "$file" | rev | cut -c 1-4` = 3pm. ] # if $file is an mp3 then echo "http://rmccurdy.no-ip.com/mp2/""$file" >> playlist.m3u echo "http://rmccurdy.no-ip.com/mp2/""$file" fi fi done } # Main function =) go_deeper cat playlist.m3u | sed 's/ /%20/g' > playlist.m3u exit 0