[BACK]Return to zmore CVS log [TXT][DIR] Up to [local] / src / usr.bin / compress

Diff for /src/usr.bin/compress/zmore between version 1.1 and 1.2

version 1.1, 2003/06/23 16:10:42 version 1.2, 2003/06/23 19:04:24
Line 37 
Line 37 
         esac          esac
 done  done
   
   # No files means read from stdin
   # XXX - cannot distinguish between gzip or compress, assume gzip
 if [ $# -eq 0 ]; then  if [ $# -eq 0 ]; then
         echo "usage: zmore filename ..."          compress -cdfgq 2>&1 | ${PAGER-more} $flags
         exit 1          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          compress -cdfq "$1" 2>&1 | ${PAGER-more} $flags
         prev="$1"          prev="$1"
         shift          shift
         test $# -eq 0 && break          if tty -s && test -n "$oterm" -a $# -gt 0; then
         #echo -n "--More--(Next file: $1)"                  #echo -n "--More--(Next file: $1)"
         echo -n "$prev (END) - Next: $1 "                  echo -n "$prev (END) - Next: $1 "
         trap "stty $oterm 2>/dev/null" 0 1 2 3 13 15                  trap "stty $oterm 2>/dev/null" 0 1 2 3 13 15
         stty cbreak -echo 2>/dev/null                  stty cbreak -echo 2>/dev/null
         REPLY=`dd bs=1 count=1 2>/dev/null`                  REPLY=`dd bs=1 count=1 2>/dev/null`
         stty $oterm 2>/dev/null                  stty $oterm 2>/dev/null
         trap - 0 1 2 3 13 15                  trap - 0 1 2 3 13 15
         echo                  echo
         case "$REPLY" in                  case "$REPLY" in
                 s)                          s)
                         shift                                  shift
                         ;;                                  ;;
                 e|q)                          e|q)
                         break                                  break
                         ;;                                  ;;
         esac                  esac
           fi
 done  done
 exit 0  exit 0

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2