i have written a code to find the number of alphabet 'a' in a file
my code is below
Code:
count=`cat $fname | grep -ic 'a' `
echo $count
where $fname is name of a file
my file contents are:
Aathira
apple
pineapple and
orange
Actually answer should be 7 but its coming as 5
In the string 'Aathira' only one 'a' is counted
How it can be rectified??