Skip to content

Instantly share code, notes, and snippets.

@panzi
Created June 21, 2013 01:54
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 panzi/5828322 to your computer and use it in GitHub Desktop.
Save panzi/5828322 to your computer and use it in GitHub Desktop.
Makes a playlist of all audio files in directory and all descendant directories. It detects audio files just by some well known file name extensions.
#!/bin/sh
dir="$1"
playlist="$2"
if [ "$playlist" = "" ]; then
playlist=playlist.m3u
fi
find "`readlink -f "$dir"`" -type f -and \( -iname '*.mp3' -or -iname '*.ogg' -or -iname '*.wav' -or -iname '*.flac' -or -iname '*.m4a' -or -iname '*.aac' -or -iname '*.wma' -or -iname '*.opus' \) > "$playlist"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment