title: gzip decompress a property in a json file using bash
body: <p>I have to verify that the base64 encoded and gzipped contents of a property in a json file are the same as the raw ones using bash.</p>
  
  <p>I have been able to extract the property using jq:</p>
  
  <pre><code>cat src/my-file.json | jq '.Attachment[] | .Contents["@Value"] | @base64d'
  </code></pre>
  
  <p>I have tried using <code>gzip</code> to decompress this using <code>@gzipd</code> filter </p>
  
  <blockquote>
    <p>jq: error (at :798): gzipd is not a valid format</p>
  </blockquote>
  
  <p>and piping the value to <code>gunzip</code> command:</p>
  
  <blockquote>
    <p>gunzip: unknown compression format</p>
  </blockquote>
  
  <p>I have tried writing the contents to a file named test.gz and then using <code>gunzip</code>.</p>
  
  <pre><code>cat src/my-file.json | jq '.Attachment[] | .Contents["@Value"] | @base64d' &gt; test.gz
  </code></pre>
  
  <blockquote>
    <p>gunzip: test.gz: not in gzip format</p>
  </blockquote>