Looking for Programmers

Andy Bradford amb-plug at bradfords.org
Fri Mar 10 18:20:56 MST 2006


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.

Andy
--
[-----------[system uptime]--------------------------------------------]
  6:20pm  up 105 days,  7:49,  1 user,  load average: 0.00, 0.00, 0.00



More information about the PLUG mailing list