Annotation of coherent/g/usr/bin/gzip/zcmp.in, revision 1.1.1.1

1.1       root        1: :
                      2: #!/bin/sh
                      3: 
                      4: OPTIONS=
                      5: FILES=
                      6: for ARG
                      7: do
                      8:        case "$ARG" in
                      9:        -*)     OPTIONS="$OPTIONS $ARG";;
                     10:        *)      FILES="$FILES $ARG";;
                     11:        esac
                     12: done
                     13: if test -z "$FILES"; then
                     14:        echo "Usage: zcmp [cmp_options] file [file]"
                     15:        exit 1
                     16: fi
                     17: set $FILES
                     18: if test $# -eq 1; then
                     19:        FILE=`expr $1 : '\(.*\)\.Z' '|' $1`
                     20:        gzip -cd $FILE | ${CMP-cmp} $OPTIONS - $FILE
                     21:        STAT="$?"
                     22: elif test $# -eq 2; then
                     23:        case "$1" in
                     24:        *.Z)    case "$2" in
                     25:                *.Z)    F=`basename $2 .Z`
                     26:                        gzip -cd $2 > /tmp/$F.$$
                     27:                        gzip -cd $1 | ${CMP-cmp} $OPTIONS - /tmp/$F.$$
                     28:                        STAT="$?";;
                     29:                *)      gzip -cd $1 | ${CMP-cmp} $OPTIONS - $2;;
                     30:                esac;;
                     31:        *)      case "$2" in
                     32:                *.Z)    F=`basename $2 .Z`
                     33:                        gzip -cd $2 > /tmp/$F.$$
                     34:                        ${CMP-cmp} $OPTIONS $1 /tmp/$F.$$
                     35:                        STAT="$?";;
                     36:                *)      ${CMP-cmp} $OPTIONS $1 $2
                     37:                        STAT="$?";;
                     38:                esac;;
                     39:        esac
                     40:        exit "$STAT"
                     41: else
                     42:        echo "Usage: zcmp [cmp_options] file [file]"
                     43:        exit 1
                     44: fi

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.