clear echo -e \"enter file one : \\c\" read fone while [ -z \"$fone\" ] ; do echo -e \"request :: please enter file name \" echo -e \"\\n\\tfile one : \\c\" read fone done if [ ! -e $fone ] ; then echo -e \"error :: file one $fone doesn\'t exist. can\'t proceed.\" read empty exit 1 fi echo -e \"enter file two : \\c\" read ftwo while [ -z \"$ftwo\" ]; do echo -e \"request :: please enter file name \" echo -e \"\\n\\tfile two : \\c\" read ftwo done if [ ! -e $ftwo ] ; then echo -e \" error :: file one $ftwo doesn\'t exist. can\'t proceed.\" read empty exit 1 fi spell $fone $ftwo > spellerror.log errword=\`cat spellerror.log | wc -l\` echo -e \"enter for continue\" echo -e \"wrong spelling in both fiels : \" cat spellerror.log echo -e \"total wrong words = $errword \" echo -e \"\\n enter for continue\" read empty while [ $errword -gt 0 ] ; do word=\`sed -n \"$errword p\" spellerror.log \` echo -e \"word -> $word \" echo -e \"do u want update? (y/n) : \\c \" read choice if [ $choice = \"y\" -o $choice = \"y\" ]; then echo -e \"new word : \\c\" read newword findfile=\`grep -e $word -c $fone\` if [ $findfile -gt 0 ]; then sed \"s/$word/$newword/g\" $fone > fone.tmp mv -f fone.tmp $fone fi findfile=\`grep -e $word -c $ftwo\` if [ $findfile -gt 0 ]; then sed \"s/$word/$newword/g\" $ftwo > ftwo.tmp mv -f ftwo.tmp $ftwo fi fi errword=\`expr $errword - 1\` done OUTPUT *********** [04mca58@LINTEL 04mca58]$ sh spell1.sh enter file one : f1 enter file two : f2 enter for continue wrong spelling:- ths fle chk purps enter for continue wrong word -> ths do u want to update? (y/n) : y new word : this wrong word -> fle do u want to update? (y/n) : y new word : file wrong word ->chk do u want to update? (y/n) : y new word : check wrong word -> purps do u want to update? (y/n) : y new word : purpose