title: Bash capturing output of awk into array
body: <p>I am stuck on a little problem. I have a command which pipes output to awk but I want to capture the output of to an array one by one.</p>
  
  <p>My example:</p>
  
  <pre><code>myarr=$(ps -u kdride | awk '{ print $1 }')
  </code></pre>
  
  <p>But that capture all my output into one giant string separated by commas:</p>
  
  <pre><code>output: PID 3856 5339 6483 10448 15313 15314 15315 15316 22348 29589 29593 32657 1
  </code></pre>
  
  <p>I also tried the following:</p>
  
  <pre><code>IFS=","
  myarr=$(ps -u kdride | awk '{ print $1"," }')
  
  But the output is: PID, 3856, 5339, 6483, 10448, 15293, 15294, 15295, 15296, 22348, 29589, 29593, 32657,
  1
  </code></pre>
  
  <p>I want to be able to capture each individual pid into its own array element. Setting <code>IFS = '\n'</code> does not do anything and retains my original output. What change do I need to do to make this work?</p>