.I Zless
is a filter which allows examination of compressed or plain text files
one screenful at a time on a soft-copy terminal. It is the equivalent of
-setting the environment variable PAGER to
-.I less,
-and then running zmore. However, enough people seem to think that having the
+setting the environment variable LESSOPEN to "|gzip -cdfq %s",
+and then running
+.IR less .
+However, enough people seem to think that having the
command
.I zless
available is important to be worth providing it.
:
#!/bin/sh
-
-: ${PAGER=less}
-export PAGER
-
-PATH="BINDIR:$PATH"
-export PATH
-
-ZMORE_PROGRAM_NAME=$0
-export ZMORE_PROGRAM_NAME
-
-exec zmore ${1+"$@"}
+PATH="BINDIR:$PATH"; export PATH
+LESSOPEN="|gzip -cdfq %s"; export LESSOPEN
+exec less "$@"