#!/bin/sh # edit with locking if [ "$1" = "" ]; then cat <&2 exit 1 fi if [ ! -w $file ]; then echo "$0: $file is not writeable" >&2 exit 1 fi wlock -s $file ${EDITOR:-vi} "$@" $file || wlock -vt $file