#!/bin/sh # $Id: evim 356 2011-09-24 23:25:47Z svnuser $ # evim uses RCS to check out a file, edit it with vim, then check it back in # Feb. 2000 by James T. Reese # rcsdiff added by Marc # SUDO/LOGNAME check suggested by Peter Duff, added by Marc if [ $# -lt 1 ]; then echo "Usage: $0 file [file] ..." exit 1 fi if [ "$LOGNAME" = root ]; then if [ -n "$SUDO_USER" ]; then USER=$SUDO_USER else echo "You are using evim as root. Please enter your login" read USER fi else # This is already set in theory, but this is a "just in case" [tm] USER=$LOGNAME fi /usr/bin/co -l "$@" && ${EDITOR:-vim} $* && rcsdiff -u "$@" | less && echo "type enter to accept diff or ^C to abort" && read && /usr/bin/ci -w"$USER" -u "$@" || (echo "*** An ERROR occured. ***"; exit 1) exit 0