Fix doubled code
Stupid boy is stupid.
This commit is contained in:
parent
d4ea0a0dcf
commit
fe8d6cbb3a
@ -21,36 +21,6 @@ do
|
||||
done
|
||||
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[@]}
|
||||
do
|
||||
if ! grep $word "CABSC.dict" > /dev/null
|
||||
|
Loading…
x
Reference in New Issue
Block a user