Mercurial > hg > sv-dependency-builds
annotate src/bzip2-1.0.6/bzmore @ 4:e13257ea84a4
Add bzip2, zlib, liblo, portaudio sources
author | Chris Cannam |
---|---|
date | Wed, 20 Mar 2013 13:59:52 +0000 |
parents | |
children |
rev | line source |
---|---|
Chris@4 | 1 #!/bin/sh |
Chris@4 | 2 |
Chris@4 | 3 # Bzmore wrapped for bzip2, |
Chris@4 | 4 # adapted from zmore by Philippe Troin <phil@fifi.org> for Debian GNU/Linux. |
Chris@4 | 5 |
Chris@4 | 6 PATH="/usr/bin:$PATH"; export PATH |
Chris@4 | 7 |
Chris@4 | 8 prog=`echo $0 | sed 's|.*/||'` |
Chris@4 | 9 case "$prog" in |
Chris@4 | 10 *less) more=less ;; |
Chris@4 | 11 *) more=more ;; |
Chris@4 | 12 esac |
Chris@4 | 13 |
Chris@4 | 14 if test "`echo -n a`" = "-n a"; then |
Chris@4 | 15 # looks like a SysV system: |
Chris@4 | 16 n1=''; n2='\c' |
Chris@4 | 17 else |
Chris@4 | 18 n1='-n'; n2='' |
Chris@4 | 19 fi |
Chris@4 | 20 oldtty=`stty -g 2>/dev/null` |
Chris@4 | 21 if stty -cbreak 2>/dev/null; then |
Chris@4 | 22 cb='cbreak'; ncb='-cbreak' |
Chris@4 | 23 else |
Chris@4 | 24 # 'stty min 1' resets eof to ^a on both SunOS and SysV! |
Chris@4 | 25 cb='min 1 -icanon'; ncb='icanon eof ^d' |
Chris@4 | 26 fi |
Chris@4 | 27 if test $? -eq 0 -a -n "$oldtty"; then |
Chris@4 | 28 trap 'stty $oldtty 2>/dev/null; exit' 0 2 3 5 10 13 15 |
Chris@4 | 29 else |
Chris@4 | 30 trap 'stty $ncb echo 2>/dev/null; exit' 0 2 3 5 10 13 15 |
Chris@4 | 31 fi |
Chris@4 | 32 |
Chris@4 | 33 if test $# = 0; then |
Chris@4 | 34 if test -t 0; then |
Chris@4 | 35 echo usage: $prog files... |
Chris@4 | 36 else |
Chris@4 | 37 bzip2 -cdfq | eval $more |
Chris@4 | 38 fi |
Chris@4 | 39 else |
Chris@4 | 40 FIRST=1 |
Chris@4 | 41 for FILE |
Chris@4 | 42 do |
Chris@4 | 43 if test $FIRST -eq 0; then |
Chris@4 | 44 echo $n1 "--More--(Next file: $FILE)$n2" |
Chris@4 | 45 stty $cb -echo 2>/dev/null |
Chris@4 | 46 ANS=`dd bs=1 count=1 2>/dev/null` |
Chris@4 | 47 stty $ncb echo 2>/dev/null |
Chris@4 | 48 echo " " |
Chris@4 | 49 if test "$ANS" = 'e' -o "$ANS" = 'q'; then |
Chris@4 | 50 exit |
Chris@4 | 51 fi |
Chris@4 | 52 fi |
Chris@4 | 53 if test "$ANS" != 's'; then |
Chris@4 | 54 echo "------> $FILE <------" |
Chris@4 | 55 bzip2 -cdfq "$FILE" | eval $more |
Chris@4 | 56 fi |
Chris@4 | 57 if test -t; then |
Chris@4 | 58 FIRST=0 |
Chris@4 | 59 fi |
Chris@4 | 60 done |
Chris@4 | 61 fi |