title: problem in matching line using while loop in bash
body: <p>I have two files </p>
  
  <p>file1</p>
  
  <blockquote>
  <pre><code>K00940
  K02183
  K03781
  K13413
  K13414
  K13424
  K13425
  K13449
  K14496
  K14497
  K14498
  K14509
  K14510
  K14512
  K17686
  K20535
  K20557
  K20600
  K20603
  K20606
  K20607
  K20716
  K20718
  K20726
  </code></pre>
  </blockquote>
  
  <p>and </p>
  
  <p>file2</p>
  
  <pre><code>  K00940 ndk; nucleoside-diphosphate kinase [EC:2.7.4.6]
              K02183 CALM; calmodulin
              K03781 katE; catalase [EC:1.11.1.6]
              K13413 MKK4_5; mitogen-activated protein kinase kinase 4/5 [EC:2.7.12.2]
              K13414 MEKK1; mitogen-activated protein kinase kinase kinase 1 [EC:2.7.11.25]
              K13424 WRKY33; WRKY transcription factor 33
              K13425 WRKY22; WRKY transcription factor 22
              K13449 PR1; pathogenesis-related protein 1
  </code></pre>
  
  <p>I am using the following script to match the first file with the second  file</p>
  
  <pre><code>cat file1 |while read line;do grep $line file2 &gt;&gt;file3 done
  </code></pre>
  
  <p>but it is not working file3 is empty.
  can anyone help regarding this matter?</p>