title: Concatenate inputs in string while in loop
body: <p>I have a variable of sources that is basically a string of comma-separated elements:</p>
  
  <pre><code>SOURCES="a b c d e"
  </code></pre>
  
  <p>I want the user to input one destination for each of this source, and I want hence to store this input into a string looking like the above but containing the destinations. If I want to assign a=1, b=2... etc, I would have something like this:</p>
  
  <pre><code>echo $DESTINATIONS &gt;&gt;&gt; "1 2 3 4 5"
  </code></pre>
  
  <p>In order to do the above, I do this:</p>
  
  <pre><code>SOURCES="a b c d e"
  DESTINATIONS=""
  
  for src in $SOURCES
  do
      echo Input destination to associate to the source $src:
      read dest
      DESTINATIONS=$DESTINATIONS $dest
  done
  </code></pre>
  
  <p>However, if I do an <code>echo</code> on <code>$DESTINATIONS</code>, I find it empty.
  Moreover, at each loop, my shell tells me:</p>
  
  <pre><code>-bash: = **myInput**: command not found
  </code></pre>
  
  <p>Any idea where I'm doing wrong?</p>