From 985ae88d86e5ff71fdf016a33897fc34cad4a68a Mon Sep 17 00:00:00 2001 From: "nw@retrocomputingtasmania.com" Date: Tue, 6 Mar 2012 09:40:22 +0000 Subject: [PATCH] Bash script to extract words from files with a count --- tools/uniquewordcount | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100755 tools/uniquewordcount diff --git a/tools/uniquewordcount b/tools/uniquewordcount new file mode 100755 index 0000000..ff447f6 --- /dev/null +++ b/tools/uniquewordcount @@ -0,0 +1,7 @@ +#!/bin/bash +# +# list words in a file with a uniqness count to identify typing mistakes. +# Usage: ./uniquewordcount MyFile | more +# ./uniquewordcount < MyFile > UniqueWordsWithCount +# +(echo "$1"; cat) | tr -cs "[:alpha:]" "\n" | sort | uniq -c