
# UNISRC_ID: @(#)vp.sh	26.1	84/07/03  
# Script to edit protected file with vi.

if [ $# -ne 1 ]
then
	echo "usage: $0 file" >&2
	exit 1
fi

if [ ! -f "$1" ]
then
	echo "$0: can't edit $1" >&2
	exit 1
fi

trap "chmod -w $1; trap '' 0; exit" 0 1 2 3	# also handles reprotect.

set -x
chmod +w "$1"
vi "$1"
