First the specific problem:
In linux, I use zcat to list a .zip file. In osx, zcat seems to automatically append .Z to the file name. Various people suggest replacing zcat with gzcat; however, gzcat complains that the file is not in gzip format!
‘file ‘ shows this:
…Zip archive data, at least v2.0 to extract
So neither zcat or gzcat will work in osx, what can I do?
I have a medium sized script in in bash which uses, zcat/gzcat, sed awk and other basic utilities to process a number of files. I’d like to duplicate that environment on my osx laptop so I can work offline. Any general suggestions how I can avoid such pain? I expect this is a fairly routine workflow so must have been sorted out by others.
The Mac OS X version of
gzip(1) doesn’t support reading zip files. From the man page:
This version of gzip is also capable of decompressing files compressed using
gunzipcan currently decompress files created by
Third parties have packaged GNU gzip for Mac OS X; you can find these from a web search. That is probably the path of least resistance.
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.