Viewing zip archive contents using 'less' on OS X
In OS X I suggest to directly install lesspipe
, for those who use brew
(thanks Dmitry) :
brew install lesspipe
Append the following to your ~/.zshrc
:
export LESSOPEN="|/usr/local/bin/lesspipe.sh %s" LESS_ADVANCED_PREPROCESSOR=1
Or Macports:
sudo port install lesspipe
To use lesspipe, set this in your ~/.zshrc
:
export LESSOPEN='| /opt/local/bin/lesspipe.sh %s'
less uses $LESSOPEN
to point to a script that will preprocess the file being passed to less. In the case of a .zip file the script runs zipinfo
against it, returning information about the archive. Copy the script from a Linux machine and configure your OS X machine to use it.