title: Creating an array of Strings from Grep Command
body: <p>I'm pretty new to Linux and I've been trying some learning recently. One thing I'm struggling is Within a log file I would like to grep for all the unique IDs that exist and store them in an array.</p>
  <p>The format of the ids are like so <em>id=12345678,</em></p>
  <p>I'm struggling though to get these in to an array. So far I've tried a range of things, the below however</p>
  <pre><code>a=($ (grep -HR1 `id=^[0-9]' logfile))
  echo ${#a[@]}
  </code></pre>
  <p>but the echo count is always returned as 0. So it is clear the populating of the array is not working. Have explored other pages online, but nothing seems to have a clear explanation of what I am looking for exactly.</p>