Last active
August 29, 2015 14:05
-
-
Save paunin/1d3150b5a530691c1a9b to your computer and use it in GitHub Desktop.
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 | |
#Simple playlist generator m3u | |
#@author paunin | |
OLDIFS=$IFS | |
IFS=$'\n' | |
rm -rf playlists | |
mkdir playlists | |
find $1 -maxdepth 1 -type d | while read dir | |
do | |
#echo $dir | |
plist=$(basename "$dir") | |
echo "Create playlist - $plist" | |
find -E $dir -regex '.*\.(mp3|alac)$' | while read file | |
do | |
echo "Add $file to $plist" | |
echo "$file" >> "./playlists/$plist.m3u" | |
done | |
find -E | |
done | |
IFS=$OLDIFS | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment