Looking for Programmers

Tyler Strickland tyler at tylers.org
Fri Mar 10 18:37:51 MST 2006

On 03/10/2006 06:20 PM, Andy Bradford wrote:
> Thus said Andy Bradford on Fri, 10 Mar 2006 18:05:49 MST:
>>Here's my quick and dirty one-liner in shell:
>>for I in `strings filename.txt`; do blah=`echo $I | sed -e 's/[^a-zA-Z]//g' -e '/^$/d'`; if grep "^$blah$" /usr/share/dict/words; then echo $blah; fi; done | awk '{ a[$1]++ } END { for (b in a) printf("%-15s %6d\n", b, a[b]); }'
> Did I mention this was dirty?  strings apparently cannot be used in this
> fashion since it  is only meant for non-text files.  Back to the drawing
> board.

Just switch 'strings' for 'cat' and that problem is fixed, though there 
is one more problem - it doubles your word counts.  Add -q to the grep 
statement and that one's fixed too.


More information about the PLUG mailing list