Created
May 16, 2018 15:19
-
-
Save Eddy-Barraud/54f386fe8edc18b4832f1e52be14c695 to your computer and use it in GitHub Desktop.
Create a Playlist of every songs inside every folders present at current directory
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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