title: Linux bash: Compare hash strings without setting variables
body: <p>I want a simple bash command to compare two hash values that outputs whether they are the same. Here's what I've tried:</p>
  
  <p><code>md5sum file1 | awk '{print $1}' # outputs hash value without filename</code></p>
  
  <p><code>md5sum file1 &gt; md5sum file2 # no output even though files/hashes differ</code></p>
  
  <p>I've tried variations on the following with no success so far:</p>
  
  <p><code>[ md5sum states.txt | awk '{print $1}' == md5sum states_copy.txt | awk '{print $1}' ]</code></p>
  
  <p><code>[ (md5sum states.txt | awk '{print $1}') == (md5sum states_copy.txt | awk '{print $1}') ]</code></p>
  
  <p>I'm open to a script or multi-line bash solution, or using shasum, but I'm new to Linux and bash so trying to keep it as simple as possible.</p>
  
  <p>I'm running Ubuntu 18.04.</p>