title: Useing sed to replace strings in a file from key-values in a TSV file
body: <p>I have a TSV file with two columns (changes.txt). I want to replace every occurance from the first column in a file, with the value of the second column.</p>
  <p>I have tried this:</p>
  <p><code>while IFS=$'\t' read -r changes.txt $var1 $var2 ; do sed -i -e &quot;s/$var1/$var2/g&quot; file.to.change.txt ; done</code></p>
  <p>Example changes.txt</p>
  <pre><code>cat   dog
  cow   sheep
  </code></pre>
  <p>Example file to change.txt</p>
  <pre><code>cat
  pelican
  cow
  goose
  duck
  pig
  </code></pre>
  <p>Expected output:</p>
  <pre><code>dog
  pelican
  sheep
  goose
  duck
  pig
  </code></pre>
  <p>This gives errors. Is there a better way of doing this?</p>