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

  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: zdiff [diff_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 | ${DIFF-diff} $OPTIONS - $FILE
  21.     STAT="$?"
  22. elif test $# -eq 2; then
  23.     case "$1" in
  24.     *.z | *.Z)    case "$2" in
  25.         *.z | *.Z)    F=`basename $2 .z`
  26.             gzip -cd $2 > /tmp/$F.$$
  27.             gzip -cd $1 | ${DIFF-diff} $OPTIONS - /tmp/$F.$$
  28.             STAT="$?";;
  29.         *)    gzip -cd $1 | ${DIFF-diff} $OPTIONS - $2
  30.             STAT="$?";;
  31.         esac;;
  32.     *)    case "$2" in
  33.         *.z | *.Z) gzip -cd $2 | ${DIFF-diff} $OPTIONS $1 -
  34.             STAT="$?";;
  35.         *)    ${DIFF-diff} $OPTIONS $1 $2
  36.             STAT="$?";;
  37.         esac;;
  38.     esac
  39.     exit "$STAT"
  40. else
  41.     echo "Usage: zdiff [diff_options] file [file]"
  42.     exit 1
  43. fi
  44.