Closer to actual product

Has nasty input error, user can't enter options.  Exploring solutions...
This commit is contained in:
Chris N 2016-02-03 15:08:48 -10:00
parent 3256560d0e
commit f2b2be4281

View File

@ -1,9 +1,32 @@
echo Enter file name
echo "Enter name of file to check:"
read fname
#Check if dictionary file exists yet
if [ ! -f CABSC.dict ]
then
echo "" > CABSC.dict
fi
#Read file line by line
while read line
do
#Read each word on line
for word in $line
do
echo "word = '$word'"
if ! grep $word "CABSC.dict" > /dev/null
then
echo $word is not in dictionary
echo "Would you like to add it? <y/n>"
read ans
while [ $ans != "y" -a $ans != "n" ]
do
echo y or n only
read ans
done
if test $ans == "y"
then
$word >> CABSC.dict
fi
fi
done
done < $fname