echo "Enter word,filename";
read word filename
n=`grep -c "$word" $filename`;
echo "The word [$word] in the $filename has occurred in $n lines";
OUTPUT
Safi>sh eb.sh
Enter word,filename
word eb.sh
The word word in the eb.sh has occured in 4 lines
Safi>sh eb.sh
Enter word,filename
for eb.sh
The word for in the eb.sh has occured in 0 lines
read word filename
n=`grep -c "$word" $filename`;
echo "The word [$word] in the $filename has occurred in $n lines";
OUTPUT
Safi>sh eb.sh
Enter word,filename
word eb.sh
The word word in the eb.sh has occured in 4 lines
Safi>sh eb.sh
Enter word,filename
for eb.sh
The word for in the eb.sh has occured in 0 lines