title: Bash loop to compare files
body: <p>I'm obviously missing something simply, and know the problem is that it's creating a blank output which is why it can't compare. However if someone could shed some light on this it would be great - I haven't isolated it.</p>
  
  <p>Ultimately, I'm trying to compare the <code>md5sum</code> from a list stored in a txt file, to that stored on the server. If errors, I need it to report that. Here's the output:</p>
  
  <pre><code>root@vps [~/testinggrounds]# cat md5.txt | while read a b; do
  &gt;   md5sum "$b" | read c d
  &gt;   if [ "$a" != "$c" ] ; then
  &gt;     echo "md5 of file $b does not match"
  &gt;   fi
  &gt; done
  md5 of file file1 does not match
  md5 of file file2 does not match
  
  root@vps [~/testinggrounds]# md5sum file*
  2a53da1a6fbfc0bafdd96b0a2ea29515  file1
  bcb35cddc47f3df844ff26e9e2167c96  file2
  
  root@vps [~/testinggrounds]# cat md5.txt
  2a53da1a6fbfc0bafdd96b0a2ea29515  file1
  bcb35cddc47f3df844ff26e9e2167c96  file2
  </code></pre>