W.A.S.S to print the following:
i. Count of characters, words and lines from a file.
ii. Count of five character words.
iii. Convert all lower case characters to upper case.
Program
#W.A.S.S. to Count of characters, words and lines from a file.
echo -e "Total character in the file are: \c"
cat good.sh |wc -c
echo -e "Total words in the file are: \c"
cntw=0
for w in `cat good.sh`
do
cntw=`expr $cntw + 1`
done
echo "$cntw"
echo -e "Total lines in the file are : \c"
cat good.sh | wc –l
Output
Total character in the file are: 162
Total words in the file are: 27
Total lines in the file are : 15