title: Writing a comparison BATCH file to verify sha256sum to released code
body: <p>Trying to write a script that takes 2 arguments ($1 and $2) one to represent the $hash and the $file_name.</p>
  <p>I am trying to utilize <code>jq</code> to parse the required data to download and compare PASS or FAIL.</p>
  <p>I see to be stuck trying to think this out.</p>
  <p>Here is my code</p>
  <pre><code>#!/usr/bin/env sh
  #
  # Sifchain shasum check (revised).
  #
  
  # $1
  hash_url=$( curl -R -s https://api.github.com/repos/Sifchain/sifnode/releases | jq '.[] | select(.name==&quot;v0.10.0-rc.4&quot;)' | jq '.assets[]' | jq 'select(.name==&quot;sifnoded-v0.10.0-rc.4-linux-amd64.zip.sha256&quot;)' | jq '.browser_download_url' | xargs $1 $2 )
  echo $hash_url
  # $2
  hash=$( curl -s -L $hash_url | jq'.$2')
  
  file_name=$(curl -R -s https://api.github.com/repos/Sifchain/sifnode/releases | jq '.[] | .name')
  
  
  
  #
  #
  echo $hash | sha256sum
  echo $file_name | sha256sum #null why?
  echo &quot;\n&quot;
  ## version of the release $1,     and the hash $2
  ## sha256 &lt;expected_sha_256_sum&gt; &lt;name_of_the_file&gt;
  sha256() {
    if echo &quot;$1  $2&quot; #| sha256sum -c --quiet
    then
      echo pass $1 $2
      exit 0
    else
      echo FAIL $1 $2
      exit 1
    fi
  }
  
  # Invoke sha256
  sha256 $hash_url $file_name
  </code></pre>
  <p>Ideally this should work for any comparison of hash with correct file, pulling the 2 parameters when the BASH script is invoked.</p>