title: Storing command output lines into array based on new line character
body: <p>I have a variable as below &amp; i perform certain operations to print the output one by one as mentioned below.</p>
  
  <pre><code>a="My name is A. Her Name is B. His Name is C"
  echo "$a" | awk -F '[nN]ame |\\.' '{for (i=2; i&lt;=NF; i+=2) print $i}'
  </code></pre>
  
  <p><strong>The output is</strong> </p>
  
  <pre><code>is A
  is B
  is C
  </code></pre>
  
  <p>When I store the results into an array, it considers space as array separator and stores value. but i want to store the each line of the output to each array index values as below</p>
  
  <pre><code>x=($(awk -F '[nN]ame |\\.' '{for (i=2; i&lt;=NF; i+=2) print $i}' &lt;&lt;&lt; "$a"))
  </code></pre>
  
  <p><strong>out puts ,</strong></p>
  
  <pre><code>${x[0]} = is
  ${x[1]} = A
  ..and so on...
  </code></pre>
  
  <p><strong>What i expect is</strong> </p>
  
  <pre><code>${x[0]} = is A
  ${x[1]} = is B
  ${x[2]} = is C
  </code></pre>
  
  <p>Also <code>echo ${#x[@]} = 6</code> ; It should be <code>= 3</code></p>