Fix doubled code

Stupid boy is stupid.
This commit is contained in:
Chris N 2016-02-03 18:23:00 -10:00
parent d4ea0a0dcf
commit fe8d6cbb3a

View File

@ -21,36 +21,6 @@ do
done done
done < $fname done < $fname
for word in ${words[@]}
do
if ! grep $word "CABSC.dict" > /dev/null
then
echo $word is not in dictionary
"spellcheckerv1.sh" 41 lines, 744 characters written
cs350s1@cs350admin-Virtual-Machine ~ $ cat spellcheckerv1.sh
#!/bin/bash
echo "Enter name of file to check:"
read fname
#Make array to hold words
words=()
#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
words+=("$word")
done
done < $fname
for word in ${words[@]} for word in ${words[@]}
do do
if ! grep $word "CABSC.dict" > /dev/null if ! grep $word "CABSC.dict" > /dev/null