3 # Copyright (C) 2001 Free Software Foundation
4 # Copyright (C) 1992, 1993 Jean-loup Gailly
5 # Adapted to LZMA utils from gzip-1.3.3 + Red Hat's security patches
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 if test "`echo "$0" | sed 's|.*/||'`" = "lzless"; then
26 if test "`echo -n a`" = "-n a"; then
27 # looks like a SysV system:
32 oldtty=`stty -g 2>/dev/null`
33 if stty -cbreak 2>/dev/null; then
34 cb='cbreak'; ncb='-cbreak'
36 # 'stty min 1' resets eof to ^a on both SunOS and SysV!
37 cb='min 1 -icanon'; ncb='icanon eof ^d'
39 if test $? -eq 0 -a -n "$oldtty"; then
40 trap 'stty $oldtty 2>/dev/null; exit' 0 2 3 5 10 13 15
42 trap 'stty $ncb echo 2>/dev/null; exit' 0 2 3 5 10 13 15
47 echo usage: zmore files...
49 lzma -dc | eval ${PAGER-more}
56 if test $FIRST -eq 0; then
57 echo $n1 "--More--(Next file: $FILE)$n2"
58 stty $cb -echo 2>/dev/null
59 ANS=`dd bs=1 count=1 2>/dev/null`
60 stty $ncb echo 2>/dev/null
62 if test "$ANS" = 'e' -o "$ANS" = 'q'; then
66 if test "$ANS" != 's'; then
67 echo "------> $FILE <------"
68 lzma -dc "$FILE" | eval ${PAGER-more}