small changes req...
Code:
while read line ;do
words = `echo "$line" |wc -w` // counting the words of current line
##OR###
###words=` echo "$line" |awk '{print NF}'`####
If [ $((words % 2)) –eq "0" ] ; then // see if number of words is even
echo "$line" | tr '[a-z]' '[A-Z]' >> outputfile.txt // if even, change all to uppercase and copy to another file
else
echo "$line" | tr '[A-Z]' '[a-z]' >> outputfile.txt // else; odd, change all to lowercase
fi
done < File1