#!/bin/sh

# checkspelling - check the spelling of a word

spell="ispell -l" # if you have ispell installed instead
# if not, just define spell=spell or
# equivalent.

# ヒント
# "ispell -l" は標準入力から入力された単語(複数)から
# スペルの間違っている単語だけを出力します。

if [ $# -lt 1 ] ; then
echo "Usage: $0 word or words" >&2
exit 1
fi

for word in $*
do
test=`echo $word | $spell`
if [ -z "$test" ] ; then
echo "$word: spelled correctly."
else
echo "$word: misspelled."
fi
done