X-Git-Url: https://jasonwoof.com/gitweb/?p=four-random-words.git;a=blobdiff_plain;f=purple-logs-word-frequency.bash;fp=purple-logs-word-frequency.bash;h=958e75f2d05b942f0fdc86c4f0e8257ac191d217;hp=0000000000000000000000000000000000000000;hb=57d9e16554b774bd9462a659b394692a2afae0f7;hpb=cf413581531b043ebe991259f9a2502f9e226486 diff --git a/purple-logs-word-frequency.bash b/purple-logs-word-frequency.bash new file mode 100755 index 0000000..958e75f --- /dev/null +++ b/purple-logs-word-frequency.bash @@ -0,0 +1,13 @@ +#!/bin/bash + +find "$HOME/.purple/logs/" -type f -print0 \ + | xargs -0 grep -I --no-filename -v '(notice)' \ + | sed -e 's/<[^>]*>//g; s/ / /g; s/&[nm]dash;/-/' \ + | sed -ne "s/^(..:..:.. ..) [a-zA-Z0-9@ _.-]\{1,25\}: \(.*\)$/\1/p" \ + | perl -0777 -p -e's/\s+/\n/mg' \ + | grep -v '^&.*;$' \ + | sed -e 's/^\W\+//g; s/\W\+$//g' \ + | grep '^[a-z.'\''-]\{3,16\}$' \ + | sort \ + | uniq -c \ + | sort -nr