finds top $N played songs in mpd log
--- /dev/null
+#! /bin/sh
+
+case "$1" in
+ '') N=10;;
+ *) N="$1"
+esac
+
+grep -a 'player: *played' "$FILE_LOG_MPD" \
+| awk '
+ BEGIN {
+ s = " *"
+ }
+
+ $5 == "player:" && $6 == "played" {
+ sub("^" s $1 s $2 s $3 s $4 s $5 s $6 s, "")
+ count[$0]++
+ }
+
+ END {
+ for (song in count)
+ printf("%d %s\n", count[song], song)
+ }' \
+| sort -n -k 1 -r \
+| head -"$N"
export VISUAL=$EDITOR
export DIR_GITHUB="${HOME}/Archives/Software/src/repos/remote/github.com"
export DIR_NOTES="$HOME/Documents/Notes"
+export DIR_LOG="$HOME/var/log"
+export DIR_LOG_MPD="$DIR_LOG/mpd"
+export FILE_LOG_MPD="$DIR_LOG_MPD/mpd.log"
# .Net Core
export DOTNET_ROOT=$HOME/.dotnet