#!/bin/sh
# my own cmp for use with JR's jrv.
#
# $1 is -s
# $2 and $3 are files to compare
#
# string to compare:
# (don't put special characters in it since those could cause quoting problems)
IGNORE=Z4D

# note above is hard-coded.
# probably leave it that way or make environment variable
# (but not command-line option; o.w., jrv would need to deal with it)

# be sure to generate unique temps:
# several jrv can run at the same time,
# either by one user or several.

TEMPLATE=/tmp/jrvcmpXXXXXX

# could also include, e.g., _$2 and _$3, for better names, but that gets long.
t1=`mktemp $TEMPLATE`
t2=`mktemp $TEMPLATE`

## could clean up, but will leave for now.
## useful for some debugging.
## trap 'x=$?; /bin/rm -f $t1 $t2; exit $x' 0 1 2 15

grep -v $IGNORE $2 > $t1
grep -v $IGNORE $3 > $t2
cmp -s $t1 $t2
