title: OS X Terminal Shell Script - How to compare value of 2 TXT files and run until False
body: <p>I have 2 files, 1 where NEW IP address is saved, 2 where previous IP is saved.
  I want to loop my script until value returns false.</p>
  
  <p>I have this:</p>
  
  <pre><code>dig +short myip.opendns.com @resolver1.opendns.com &gt; IPNEW.txt
  echo Getting NEW IP..
  
  until [ ! IPNEW.txt == IPOLD.txt ]
  do 
      sleep 3
      echo IP found; dig +short myip.opendns.com @resolver1.opendns.com
      dig +short myip.opendns.com @resolver1.opendns.com &gt; IPNEW.txt
      echo Checking...
  done
  </code></pre>
  
  <p>Why can't I use <code>"!"</code> ?
  How can I make this work?</p>