Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/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