title: concatenation of strings in bash results in substitution
body: <p>I need to read a file into an array and concatenate a string at the end of each line. Here is my bash script:</p>
  
  <pre><code>#!/bin/bash
  
  IFS=$'\n' read -d '' -r -a lines &lt; ./file.list
  for i in "${lines[@]}"
  do
      tmp="$i"
      tmp="${tmp}stuff"
      echo "$tmp"
  done
  </code></pre>
  
  <p>However, when I do this, an action of <code>replace</code> happens, instead of concatenation.<br></p>
  
  <p>For example, in the <code>file.list</code>, we have:<br></p>
  
  <pre><code>http://www.example1.com
  http://www.example2.com
  </code></pre>
  
  <p>What I need is:<br></p>
  
  <pre><code>http://www.example1.comstuff
  http://www.example2.comstuff
  </code></pre>
  
  <p>But after executing the script above, I get things as below on the terminal:<br></p>
  
  <pre><code>stuff//www.example1.com
  stuff//www.example2.com
  </code></pre>
  
  <p>Btw, my PC is Mac OS.</p>
  
  <p>The problem also occurs while concatenating strings via <code>awk</code>, <code>printf</code>, and <code>echo</code> commands. For example <code>echo $tmp"stuff"</code> or <code>echo "${tmp}""stuff"</code></p>