version 1.3, 2004/03/29 09:59:42 |
version 1.3.50.1, 2014/05/22 11:42:44 |
|
|
# |
# |
# $NetBSD$ |
# $NetBSD$ |
# |
# |
# $OpenBSD: zmore,v 1.4 2003/07/29 07:42:45 otto Exp $ |
# $OpenBSD: zmore,v 1.6 2008/08/20 09:22:02 mpf Exp $ |
# |
# |
# Copyright (c) 2003 Todd C. Miller <Todd.Miller@courtesan.com> |
# Copyright (c) 2003 Todd C. Miller <Todd.Miller@courtesan.com> |
# |
# |
Line 41 while test $# -ne 0; do |
|
Line 41 while test $# -ne 0; do |
|
esac |
esac |
done |
done |
|
|
|
if [ `basename $0` = "zless" ] ; then |
|
pager=${PAGER-less} |
|
else |
|
pager=${PAGER-more} |
|
fi |
|
|
# No files means read from stdin |
# No files means read from stdin |
if [ $# -eq 0 ]; then |
if [ $# -eq 0 ]; then |
gzip -cdfq 2>&1 | ${PAGER-more} $flags |
gzip -cdfq 2>&1 | $pager $flags |
exit 0 |
exit 0 |
fi |
fi |
|
|
oterm=`stty -g 2>/dev/null` |
oterm=`stty -g 2>/dev/null` |
while test $# -ne 0; do |
while test $# -ne 0; do |
gzip -cdfq "$1" 2>&1 | ${PAGER-more} $flags |
gzip -cdfq "$1" 2>&1 | $pager $flags |
prev="$1" |
prev="$1" |
shift |
shift |
if tty -s && test -n "$oterm" -a $# -gt 0; then |
if tty -s && test -n "$oterm" -a $# -gt 0; then |