是否可以使用stdin/stdout在bash中压缩/解压缩字符串?(Un/De)在bash中压缩字符串?
我尝试这样做,但显然它不支持?
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
我不熟悉linux,但我读了其他压缩实用程序手册页并找不到解决方案?
压缩将是'的base64 -w0'时base64'的'的正确使用。否则,换行符将被添加到输出中。 – JohnEye