#!/usr/bin/ksh PROGNAME=`basename $0` TMP_DIR=${TMP_DIR:-/var/tmp} usage() { { echo "Usage: $PROGNAME " } >&2 exit 1 } [ "X$1" = X -o "X$2" != X ] && usage [ ! -r $1 ] && { echo "$PROGNAME: ERROR: can't read $1" >&2; exit 1; } # Take a copy of the file, but not the permissions cat $1 > $TMP_DIR/$PROGNAME.$$.cp # Unlock the file without mailing the locker rcs -u -M $1 # That left it in a locked state so trying to do a 'co -l' will fail # even with '-q' so remove what we have. rm $1 # Now check it out co -l $1 # Now restore the copy cat $TMP_DIR/$PROGNAME.$$.cp > $1