#!/bin/bash
# See the original at http://www.usrsb.in/The-First-Spellchecker--In-6-Lines-.html

checked_file=$1
dictionary_file=/usr/share/dict/cracklib-small

cat $file_to_check | 
  tr A-Z a-z | 
    tr -c a-z '\n' | 
      sort | 
        uniq | 
          comm -13 $dictionary_file -