title: How to store the value of cat command in the variable var?
body: <p>I'm trying to find the number of times a string is repeated in a file, at the same time i've to store it in a variable.</p>
  
  <p>When i use the command (<code>cat filename | grep -c '123456789'</code>) , it displays the count correctly but when i use the below command it shows as command not found.</p>
  
  <pre><code>var =$(cat filename | grep -c '123456789')
  echo $var
  </code></pre>
  
  <p>Can u let me know where i'm wrong ?</p>