AWK: Printing lines with less than 20 characters:

 #! bin/bash
#Printing lines with less than 20 characters:  

echo "enter a filename to print from awk"
read fileName
if [[ -f $fileName ]]
then
        awk ' length($0) < 20 ' $fileName
        echo "==============================================================="
else
    echo "$fileName doesn't exist"
fi


[prabhucloudxlab@cxln4 ~]$ sh hello.sh
enter a filename to print from awk
filegrep.txt

This is Linux 2000
This is MAC 4000
This is Linux 2000
This is MAC 4000
This is Linux 2000
This is MAC 4000
This is Linux 2000
This is MAC 4000