Find Words in Text
find_words is a simple Bash script (Linux version) to find words in text. See the spell_check.pl Perl script for sample use.
#!/bin/bash
# find_words: find words (strings of one or more characters) in a text stream,
# and output them, converted to lower case [note: this should be
# optional], one word per line
#
# Usage: find_words [file]
# for tr, the -c option complements SET1, and -s squeezes repeats
if [ "$#" -eq 0 ]; then
/usr/bin/tr -cs '[A-Z][a-z]' '[\012*]' | /usr/bin/tr '[A-Z]' '[a-z]'
else
/usr/bin/tr -cs '[A-Z][a-z]' '[\012*]' < $1 | /usr/bin/tr '[A-Z]' '[a-z]'
fi
For more examples, see Samples.