niderhoff
4/27/2011 - 6:30 PM

Bash script to create .m3u playlist files for all mp3s in subdirectories

Bash script to create .m3u playlist files for all mp3s in subdirectories

#!/bin/bash
#
# bash script to create playlist files in music subdirectories
#
# Steve Carlson (steve@scarlson.co)

find . -type d | 
while read subdir
do
 rm -f *.m3u

  for filename in "$subdir"/*.mp3
  do
	echo "${filename##*/}" >> ./"$subdir"/"${subdir##*/}.m3u"
  done

done