Monday, 9 April 2018

Shell script to count the number of lines that does not contain a given word

#script to count the lines that does not contain a given word
echo enter file name and word
read file word
line=`grep -v "$word" $file| wc -l`
echo "$line lines does not contain word"



OUTPUT
Safi>sh notpres.sh
enter filename and word
notpres.sh echo
3 lines does not contain word

No comments:

Post a Comment