title: (Un/De)compress a string in bash?
body: <p>Is it possible to compress/decompress a string in bash using stdin/stdout ?</p>
  
  <p>I tried this but apparently it is not supported ?</p>
  
  <pre class="lang-shell prettyprint-override"><code>hey=$(echo "hello world" | gzip -cf)
  echo $hey # returns a compressed string
  echo $hey | gzip -cfd
  gzip: stdin is a multi-part gzip file -- not supported
  </code></pre>
  
  <p>I'm not well versed in linux but I read other compression utilities man pages and couldn't find a solution?</p>