Skip to content

Instantly share code, notes, and snippets.

@diasjorge
Created November 26, 2012 19:53
Show Gist options
  • Save diasjorge/4150239 to your computer and use it in GitHub Desktop.
Save diasjorge/4150239 to your computer and use it in GitHub Desktop.
Create playlist for all directories
IFS=$'\n'
# Find all leaf directories
for dir in $(find . -type d -exec sh -c '(ls -p "{}"|grep />/dev/null)||echo "{}"' \;);
do
cd $dir
find . -type f -iname '*mp3' | sed s/\.\\/// > "$(echo $dir | sed s/.*\\///)"-playlist.m3u
cd -
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment