X-Git-Url: https://git.gag.com/?a=blobdiff_plain;ds=sidebyside;f=zmore.in;h=547c527b6055e84c98191f25d989a189163fbe20;hb=744b66353096552f6a23a95bff7b088af24ac555;hp=64b144d840a540a0ff0f77865f13a378680f5e71;hpb=00e333a22c871925253c6a1fc57965b32c045fec;p=debian%2Fgzip diff --git a/zmore.in b/zmore.in index 64b144d..547c527 100644 --- a/zmore.in +++ b/zmore.in @@ -57,36 +57,36 @@ fi if test $# = 0; then if test -t 0; then - echo "$usage" + echo >&2 "$0: invalid number of operands; try \`$0 --help' for help" else - gzip -cdfq | eval ${PAGER-more} + gzip -cdfq | eval ${PAGER-more} fi else FIRST=1 for FILE do - case $FILE in - --h*) exec echo "$usage";; - --v*) exec echo "$version";; - esac + case $FILE in + --h*) exec echo "$usage";; + --v*) exec echo "$version";; + esac - < "$FILE" || continue - if test $FIRST -eq 0; then - echo $n1 "--More--(Next file: $FILE)$n2" - stty $cb -echo 2>/dev/null - ANS=`dd bs=1 count=1 2>/dev/null` - stty $ncb echo 2>/dev/null - echo " " - case "$ANS" in - [eq]) exit;; - esac - fi - if test "$ANS" != 's'; then - echo "------> $FILE <------" - gzip -cdfq -- "$FILE" | eval ${PAGER-more} - fi - if test -t 1; then - FIRST=0 - fi + < "$FILE" || continue + if test $FIRST -eq 0; then + echo $n1 "--More--(Next file: $FILE)$n2" + stty $cb -echo 2>/dev/null + ANS=`dd bs=1 count=1 2>/dev/null` + stty $ncb echo 2>/dev/null + echo " " + case "$ANS" in + [eq]) exit;; + esac + fi + if test "$ANS" != 's'; then + echo "------> $FILE <------" + gzip -cdfq -- "$FILE" | eval ${PAGER-more} + fi + if test -t 1; then + FIRST=0 + fi done fi