Skip to content

Instantly share code, notes, and snippets.

@tjoen
Forked from scarlson/playlist.sh
Created October 14, 2017 22:40
Show Gist options
  • Save tjoen/7ca002a556c52fbe42d40ac3a1bbad0f to your computer and use it in GitHub Desktop.
Save tjoen/7ca002a556c52fbe42d40ac3a1bbad0f to your computer and use it in GitHub Desktop.
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment