4 # Copyright (C) 2001 Free Software Foundation
5 # Copyright (C) 1992, 1993 Jean-loup Gailly
7 # This program is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 2, or (at your option)
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
17 # You should have received a copy of the GNU General Public License
18 # along with this program; if not, write to the Free Software
19 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
22 PATH="BINDIR:$PATH"; export PATH
23 if test "`echo -n a`" = "-n a"; then
24 # looks like a SysV system:
29 oldtty=`stty -g 2>/dev/null`
30 if stty -cbreak 2>/dev/null; then
31 cb='cbreak'; ncb='-cbreak'
33 # 'stty min 1' resets eof to ^a on both SunOS and SysV!
34 cb='min 1 -icanon'; ncb='icanon eof ^d'
36 if test $? -eq 0 -a -n "$oldtty"; then
37 trap 'stty $oldtty 2>/dev/null; exit' 0 2 3 5 10 13 15
39 trap 'stty $ncb echo 2>/dev/null; exit' 0 2 3 5 10 13 15
44 echo usage: zmore files...
46 gzip -cdfq | eval ${PAGER-more}
53 if test $FIRST -eq 0; then
54 echo $n1 "--More--(Next file: $FILE)$n2"
55 stty $cb -echo 2>/dev/null
56 ANS=`dd bs=1 count=1 2>/dev/null`
57 stty $ncb echo 2>/dev/null
59 if test "$ANS" = 'e' -o "$ANS" = 'q'; then
63 if test "$ANS" != 's'; then
64 echo "------> $FILE <------"
65 gzip -cdfq "$FILE" | eval ${PAGER-more}