Grep : Script for count of lines which is contains the given text (-c)

 [prabhucloudxlab@cxln4 ~]$ cat>hello.sh


#! bin/bash
# Script for case sensitive & For Line Numbers & For Count

echo " enter filename is search text from "
read filename
if [[ -f $filename ]]
then
echo "enter the text1 to search"
read grepvar1
grep -i -n -c $grepvar1 $filename
#note: -c ---->> will give the count of lines which is contains the given text

else
echo "$filename does not exist"
fi



[prabhucloudxlab@cxln4 ~]$ sh hello.sh
 enter filename is search text from
filegrep.txt
enter the text1 to search
windows
8