[singh@00-13-02-56-15-7c programs]$ vi test1
engineering
data
and
lab
workshop
programming
rdx
bpb
hp
[singh@00-13-02-56-15-7c programs]$ vi raj11.sh
#!/bin/bash
echo "Enter file name"
read file
awk '$0!~/[aeiou]/{ count++ }
END{print "The number of lines that does not contain vowels are: ",count}' $file
Output :
[singh@00-13-02-56-15-7c programs]$ sh raj11.sh
Enter file name
test1
The number of lines that does not contain vowels are: 3
engineering
data
and
lab
workshop
programming
rdx
bpb
hp
[singh@00-13-02-56-15-7c programs]$ vi raj11.sh
#!/bin/bash
echo "Enter file name"
read file
awk '$0!~/[aeiou]/{ count++ }
END{print "The number of lines that does not contain vowels are: ",count}' $file
Output :
[singh@00-13-02-56-15-7c programs]$ sh raj11.sh
Enter file name
test1
The number of lines that does not contain vowels are: 3
its not working
ReplyDeleterather the correct solution would be:
ReplyDeleteecho "Enter file name"
read f
count=0
awk '$0!~/[aeiou]/{ count++ }
END{printf "The number of lines that does not contain vowels are: %d\n",count}' $f
Is it works
DeleteThis comment has been removed by the author.
ReplyDeleteNot working
ReplyDeleteHow we a text file
ReplyDelete