function spelling { if [ $((`grep -c "^$1$" /usr/share/dict/american-english`)) -gt 0 ]; then echo -e "Spelling of\e[1;32m" `grep -m 1 "^$1$" \ /usr/share/dict/american-english` "\e[0mseems fine" else echo -e "\e[1;31mThere seems to be a mistake in spelling\e[0m" fi }
The script is run quite simply by saying "spelling word-to-be-checked". For example,
spelling lookwould say
Spelling of look seems fine
butspelling loukwould say
There seems to be a mistake in spelling
Where this is extremely useful is when you cannot remember some part of the spelling of a word. For example allitaration or alliteration. Here, I can just use a regex.
Running
spelling allit.rationwould say
Spelling of alliteration seems fine
thereby giving the right spelling.
No comments:
Post a Comment
Note: only a member of this blog may post a comment.