#usage : scriptname file-name
#this is just the logic, basic validation is only done
here
#it can be improved in a better manner.
#Some UNIX flavors have utilities which check the spellings.
while read v_line
do
IFS=" "
for v_eachword in $v_line
do
grep -i `echo $v_eachword | tr -d '[[:punct:]]'` /usr/dict/words >/dev/null
v_status=$?
if [ $v_status -eq 0 ]
then
echo "$v_eachword \c"
else
echo "\033[32m" "$v_eachword \c"
fi
echo "\033[0m\c"
done
echo
done < $1
DEMO:
DEMO:
phani >more
spell_correct
This file is
creatd to check whether the spellings are correct or wrongg in this file.
It jus checks
the spellings not the grammer.
phani
>check_spell spell_correct
This file is
creatd to check whether the spellings are correct or wrongg in this file.
It jus checks
the spellings not the grammer.
phani >