Friday, 15 May 2020

Shell script to count the number of lines in a file which does not contain a vowel.

PROGRAM

echo "Enter the file"
read fname
ans=`echo grep -v '[aeiou]' $fname|wc -l`

echo "Number of lines in $fname which does not contain a vowel is $ans."

OUTPUT
Enter the file
vw
Number of lines in vw which does not contain a vowel is 1.
 

No comments:

Post a Comment