#!/bin/bash function to_title_case { python3 -c ' import sys for line in sys.stdin: sys.stdout.write(line.title()) ' } awk -F\| '$2 == 0 { print $1 }' < ~/play-music-collection-db.txt | \ awk -F/ ' { print $3 }' | \ sed \ -e 's/\.mp3$//' \ -e 's/^[0-9]*//' \ -e 's/^ - //' \ -e 's/^-//' \ -e 's/^ \. //' \ -e 's/^\.*//' \ -e 's/^ //' \ -e 's/^\(..............................\).*$/\1/' | \ tr '[:upper:]' '[:lower:]' | \ to_title_case | \ histogram | \ sort -n -r