# Zcmp and zdiff are used to invoke the cmp or the diff pro-
# gram on compressed files. All options specified are passed
# directly to cmp or diff. If only 1 file is specified, then
# the files compared are file1 and an uncompressed file1.gz.
# If two files are specified, then they are uncompressed (if
# necessary) and fed to cmp or diff. The exit status from cmp
prog
=`echo $0 | sed 's|.*/||'`
-*) OPTIONS
="$OPTIONS $ARG";;
*) if test -f "$ARG"; then
echo "${prog}: $ARG not found or not a regular file"
if test -z "$FILES"; then
echo "Usage: $prog [${comp}_options] file [file]"
FILE
=`echo "$1" | sed 's/[-.][zZtga]*$//'`
gzip -cd "$1" |
$comp $OPTIONS - "$FILE"
*[-.
]gz |
*[-.
][zZ
] |
*.t
[ga
]z
)
*[-.
]gz |
*[-.
][zZ
] |
*.t
[ga
]z
)
F
=`echo "$2" | sed 's|.*/||;s|[-.][zZtga]*$||'`
gzip -cd "$2" > /tmp
/"$F".$$
gzip -cd "$1" |
$comp $OPTIONS - /tmp
/"$F".$$
/bin
/rm -f /tmp
/"$F".$$
;;
*) gzip -cd "$1" |
$comp $OPTIONS - "$2"
*[-.
]gz |
*[-.
][zZ
] |
*.t
[ga
]z
)
gzip -cd "$2" |
$comp $OPTIONS "$1" -
*) $comp $OPTIONS "$1" "$2"
echo "Usage: $prog [${comp}_options] file [file]"