title: BASH while loop to check lines in file displays too many times
body: <p>I am writing a script where I want to take each line from a file and check for a match in another file. 
  If I find a match I want to say that I found a match and if not, say that I did not find a match.</p>
  
  <p>The 2 files contain md5 hashes. The old file is the original and the new file is to check if there have been any changes since the original file.</p>
  
  <p>original file: chksum
  new file:chksum1</p>
  
  <pre><code>#!/bin/bash
  
  while read e; do
       while read f; do
       if [[ $e = $f ]]
       then 
       echo $e "is the same"
       else
            if [[ $e != $f]]
            then
            echo $e "has been changed"
            fi
       fi
       done &lt; chksum1
  done &lt; chksum
  </code></pre>
  
  <p>My issue is that for the files that have been changed I get an echo for every time the check in the loop is done and I only want it to display the file once and say that it was not found. </p>
  
  <p>Hope this is clear.</p>