title: bash - sed doesn't replace all semicolons
body: <p>I have three variables I write into a text file. For now it is into a variable, because try and error is faster like this. These three variables are produced by the script before and each variable has a column with values in them. Variable one for example looks like this:</p>
  
  <pre><code>hour
  minute
  minute
  day
  </code></pre>
  
  <p>I put them together using this code:</p>
  
  <pre><code>New_fileloc=$(paste &lt;(echo "$Grabinterval") &lt;(echo "$Filelocation") &lt;(echo "$Time") --delimiters ';' | sed -e 's/^\|$/"/g' -e 's/\;/";"/')
  </code></pre>
  
  <p>At the end I need each line in each column in double quotes and separated by a semicolon. At the moment I am doing that using sed in that one liner. And that works mostly fine. My output looks like this:</p>
  
  <pre><code>"hour";"A_path/to/somewhere/;2016-02-10 17:07:00Z"
  "minute";"A_path/to/somewhere/;2016-01-29 17:26:20Z"
  "minute";"A_path/to/somewhere/;2016-01-29 17:26:20Z"
  "day";"A_path/to/somewhere/;2016-01-29 00:07:00Z"
  </code></pre>
  
  <p>The first semicolon gets replaces with ";", but the second one in each line does not. I have no idea why.</p>