home *** CD-ROM | disk | FTP | other *** search
/ High Voltage Shareware / high1.zip / high1 / DIR40 / GNUZIP_.ZIP / ZMORE.IN < prev    next >
Text File  |  1993-03-28  |  612b  |  33 lines

  1. :
  2. #!/bin/sh
  3.  
  4. if test `echo -n a` = "-n a"; then
  5.   # looks like a SysV system:
  6.   n1=""; n2="\c"; cb="-icanon"; ncb="icanon"
  7. else
  8.   n1="-n"; n2=""; cb="cbreak"; ncb="-cbreak"
  9. fi
  10. trap "stty $ncb echo 2>/dev/null; exit" 2 3 5 10 13 15
  11.  
  12. FIRST=1
  13. for FILE
  14. do
  15.     if test $FIRST -eq 0; then
  16.         echo $n1 "--More--(Next file: $FILE)$n2"
  17.         stty $cb -echo 2>/dev/null
  18.         ANS=`dd bs=1 count=1 2>/dev/null` 
  19.         stty $ncb echo 2>/dev/null
  20.         echo " "
  21.         if test "$ANS" = 'e'; then
  22.             exit
  23.         fi
  24.     fi
  25.     if test "$ANS" != 's'; then
  26.         echo "------> $FILE <------"
  27.         gzip -cd "$FILE" | ${PAGER-more}
  28.     fi
  29.     if test -t; then
  30.         FIRST=0
  31.     fi
  32. done
  33.