# HG changeset patch # User Oleksandr Gavenko # Date 1249238256 -10800 # Node ID 8ba6bf51d9df263ba3237eb635268b961d6d3150 # Parent 976f8876799d50ed48200eb04c402a549fd78d52 Simple utility for searching word those not are in dictionary. diff -r 976f8876799d -r 8ba6bf51d9df find-new-words.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/find-new-words.sh Sun Aug 02 21:37:36 2009 +0300 @@ -0,0 +1,42 @@ +#!/bin/sh + +if [ -z $1 ]; then + echo "Where dictionary?" +fi + +if [ "$1" = --help ]; then + echo find-new-words DICTIONARY + echo words read from stdin + echo + echo find-new-words DICTIONARY WORDS_FILE + echo words read from file + exit 0 +fi + +dictionary=$1 + +if [ -z "$2" ]; then + while true; do + if read word; then + if grep $word $dictionary >/dev/null; then + :; + else + echo $word; + fi + else + exit 0 + fi + done +else + while true; do + if read word; then + if grep $word $dictionary >/dev/null; then + :; + else + echo $word; + fi + else + exit 0 + fi + done <$2 +fi \ No newline at end of file