title: find and replace words in files
body: <p>I have two files: <em>file1</em> and <em>file2</em>.</p>
  
  <p>Any match in <em>file2</em> should append "-W" to the word in file1.</p>
  
  <p>File1:</p>
  
  <pre><code>Verb=Applaud,Beg,Deliver
  Adjective=Bitter,Salty,Minty
  Adverb=Quickly,Truthfully,Firmly
  </code></pre>
  
  <p>file2:</p>
  
  <pre><code>Gate
  Salty
  Explain
  Quickly
  Hook
  Deliver
  Earn
  Jones
  Applaud
  Take
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>Verb=Applaud-W,Beg,Deliver-W
  Adjective=Bitter,Salty-W,Minty
  Adverb=Quickly-W,Truthfully,Firmly
  </code></pre>
  
  <p>Tried but not working and may take too long:</p>
  
  <pre><code>for i in `cat file2` ; do
  nawk -v DEE="$i" '{gsub(DEE, DEE"-W")}1' file1 &gt; newfile
  mv newfile file1
  done
  </code></pre>