Skip to content

Instantly share code, notes, and snippets.

@cdp1337
Created September 7, 2012 03:14
Show Gist options
  • Save cdp1337/3662775 to your computer and use it in GitHub Desktop.
Save cdp1337/3662775 to your computer and use it in GitHub Desktop.
Just a quick script to generate a playlist of music in the current directory.
#!/bin/bash
#
# Version 0.1
# Author Charlie Powell
#
# Name the playlist whatever this directory is called.
PLAYLIST="$(echo $(basename \\"`pwd`\\") | sed 's#\\##')"
# Create the file header, m3u was picked because it's dead simple.
echo '#EXTM3U' > "$PLAYLIST.m3u"
# And list the songs into the playlist file.
# @todo Change this to other formats if I feel like it.
ls -1 *.flac >> "$PLAYLIST.m3u"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment