Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Create a Playlist of every songs inside every folders present at current directory
#!/bin/bash
#
# bash script to create playlist files in music subdirectories
# This one will aggregate every sonds inside only one same playlist
# Steve Carlson (stevengcarlson@gmail.com)
rm -f all.m3u
find . -type d |
while read subdir
do
# rm -f "$subdir"/*.m3u
for filename in "$subdir"/*
do
if [[ ${filename##*.} =~ m4a|mp3|ogg|aac|wav|wma ]]
then
#echo "${filename##*/}" >> ./"$subdir"/"${subdir##*/}.m3u"
echo "${subdir##*/}/${filename##*/}" >> ./all.m3u
fi
done
done
#!/bin/bash
#
# bash script to create playlist files in music subdirectories
#
# Steve Carlson (stevengcarlson@gmail.com)
rm -f *.m3u
find . -type d |
while read subdir
do
rm -f "$subdir"/*.m3u
for filename in "$subdir"/*
do
if [[ ${filename##*.} =~ m4a|mp3|ogg|aac|wav|wma ]]
then
echo "${filename##*/}" >> ./"$subdir"/"${subdir##*/}.m3u"
echo "${subdir##*/}/${filename##*/}" >> ./"${subdir##*/}.m3u"
fi
done
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.