Skip to content

Instantly share code, notes, and snippets.

@agalazis
Last active August 29, 2015 14:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save agalazis/25478eb1c67d5378f0d2 to your computer and use it in GitHub Desktop.
Save agalazis/25478eb1c67d5378f0d2 to your computer and use it in GitHub Desktop.
build all plalysts from directories that contain music
#!/bin/bash
#asuming you hace a ~/playlists directory dedicated for this purpose
cd ~/
rm -rf ~/playlists/* && find ~/ -name '*.mp3' | while read line ; do fn=$(echo ${line%/*}|md5sum | cut -d ' ' -f 1); [ ! -f "playlists/$fn.m3u" ] && echo "#EXTM3U" >>"playlists/$fn.m3u";echo $line>>"playlists/$fn.m3u"; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment