On macOS, which is a full POSIX compliant UNIX (formally certified!), OpenSSL
has no zlib
support, there is no zlib-flate
either and while the first solution works as well as all the Python solutions, the first solution requires the ZIP data to be in a file and all the other solutions force you to create a Python script.
Here's a Perl based solution that can be used as a command line one-liner, gets its input via STDIN pipe and that works out of the box with a freshly installed macOS:
cat file.compressed | perl -e 'use Compress::Raw::Zlib;my $d=new Compress::Raw::Zlib::Inflate();my $o;undef $/;$d->inflate(<>,$o);print $o;'
Nicer formatted, the Perl script looks like this:
use Compress::Raw::Zlib;
my $decompressor = new Compress::Raw::Zlib::Inflate();
my $output;
undef $/;
$decompressor->inflate(<>, $output);
print $output;
Optimized version from Marco d'Itri (see comments):
cat file.compressed | perl -MCompress::Zlib -E 'undef $/;print uncompress(<>)
cat file.compressed | perl -MCompress::Zlib -E 'undef $/;print uncompress(<>)'