Skip to content

Instantly share code, notes, and snippets.

@anekos
Created March 25, 2013 11:52
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save anekos/5236641 to your computer and use it in GitHub Desktop.
Save anekos/5236641 to your computer and use it in GitHub Desktop.
#!/bin/sh
# Usage: add-random [[NUMBER [FILTER]]
sels="${1:-10}"
filter="${2:-}"
mpc listall | grep "$filter" | shuf | head "-n" "$sels" | while read selected
do
echo "$selected"
mpc add "$selected"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment