I am trying to find the number of times a line is repeated in a file, at the same time I have to store it in a variable.
When I use the command ( cat filename | grep -c '123456789' ), it displays the score correctly, but when I use the following command, it shows that the command was not found.
var =$(cat filename | grep -c '123456789') echo $var
Can you tell me where I'm wrong?
Jackie james
source share