X-Git-Url: https://git.saurik.com/apple/file_cmds.git/blobdiff_plain/39aaa94bf0a1c68b3fe15e3622c96766f0f22ff2..aad783a64f985f1e27c7ffc6e2d3f671323716a9:/gzip/zmore diff --git a/gzip/zmore b/gzip/zmore index 6b55c77..dbdbd3f 100644 --- a/gzip/zmore +++ b/gzip/zmore @@ -1,7 +1,8 @@ #!/bin/sh - # -# $NetBSD: zmore,v 1.3 2004/03/29 09:59:42 wiz Exp $ -# $OpenBSD: zmore,v 1.4 2003/07/29 07:42:45 otto Exp $ +# $NetBSD: zmore,v 1.5 2013/12/06 13:33:15 pettai Exp $ +# +# $OpenBSD: zmore,v 1.6 2008/08/20 09:22:02 mpf Exp $ # #- # Copyright (c) 2003 Todd C. Miller @@ -22,13 +23,7 @@ # Agency (DARPA) and Air Force Research Laboratory, Air Force # Materiel Command, USAF, under agreement number F39502-99-1-0512. # -# $FreeBSD: src/usr.bin/gzip/zmore,v 1.1 2007/01/26 10:19:07 delphij Exp $ - -if [ "$0" = "zless" ]; then -zpager="less" -else -zpager="more" -fi +# $FreeBSD: head/usr.bin/gzip/zmore 273507 2014-10-23 01:22:29Z delphij $ # Pull out any command line flags so we can pass them to more/less flags= @@ -48,15 +43,21 @@ while test $# -ne 0; do esac done +if [ `basename $0` = "zless" ] ; then + pager=${PAGER-less} +else + pager=${PAGER-more} +fi + # No files means read from stdin if [ $# -eq 0 ]; then - gzip -cdfq 2>&1 | ${PAGER-${zpager}} $flags + gzip -cdfq 2>&1 | $pager $flags exit 0 fi oterm=`stty -g 2>/dev/null` while test $# -ne 0; do - gzip -cdfq "$1" 2>&1 | ${PAGER-${zpager}} $flags + gzip -cdfq "$1" 2>&1 | $pager $flags prev="$1" shift if tty -s && test -n "$oterm" -a $# -gt 0; then