title: Bash storing grep into a variable
body: <p>So i need to find a word count for the amount of words in a certain file</p>
  
  <p>So in my code I have</p>
  
  <pre><code>grep -c "word" file
  </code></pre>
  
  <p>(that outputs the amount of instances we see in a file)</p>
  
  <p>but is there any way to have it stored to a variable?</p>
  
  <p>I tried </p>
  
  <pre><code>a = grep -c "word" file
  </code></pre>
  
  <p>and then <code>echo $a</code></p>
  
  <p>as well as </p>
  
  <pre><code>$a = grep -c "word file
  </code></pre>
  
  <p>How would I go about this?</p>