We want to check whether this sentence is declarative or now and then to store it in declarative.txt
file then put the rest of the sentences in others.txt
file and then put the number of lines of the declarative.txt
at the end of the file.
A sentence is "declarative" if it ends with a full stop.
input file ($1)
this life is good.
neverthe less.
suppppppppppppppppperb.
the best coders.
everything is good?
are you okay dude?
ma man !!
my code sofar
#!/bin/sh
while read row
do
x=$row | grep "\.$"
y=$row | grep -v "\.$"
echo $x >> declarative.txt
echo $y >> others .txt
done < $1
cnt=`wc -l declarative.txt`
echo $cnt >> declarative.txt