title: Shell || Adding element to array separated by line not space
body: <p>I am reading a file in a loop and there is string i got in each iteration. I need to add this element to array but in new line</p>
  
  <p>i use the blow cmd ARRAYNAME+=$ELEMENTNAME</p>
  
  <p>but what happens thet element is added to the last one but separated by " " instead of lines</p>
  
  <pre><code>while IFS='' read -r line || [[-n "$line" ]];do
  MAPPING=`echo $line | grep -e session -e sub | cut -d: -f3 | grep -i ","`
  MAPPINGMAT+=("$MAPPING")
  echo ${MAPPINGMAT[*]}
  done &lt; "$1"
  </code></pre>
  
  <p>output </p>
  
  <pre><code>1
  1 2
  1 2 3
  </code></pre>
  
  <p>but i need it to be</p>
  
  <pre><code>1
  2
  3
  </code></pre>