Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 2 Jul 1995 14:21:43 -0500 (CDT)
From:      Mike Pritchard <mpp@legarto.minn.net>
To:        freebsd-bugs@freebsd.org
Subject:   Re: List of open Problem Reports
Message-ID:  <199507021921.OAA01785@mpp.com>
In-Reply-To: <199507011130.EAA16365@freefall.cdrom.com> from "GNU GNATS" at Jul 1, 95 04:30:26 am

next in thread | previous in thread | raw e-mail | index | archive | help
> [1994/12/13] misc/48       /etc/rc does not recover recovery files
> [1995/06/23] misc/556      Bug in /etc/rc

Both of these PRs refer to the same problem, namely that the
commands that are supposed to send mail about vi recovery files
never get run.  Probably the best fix is to replace the stuff that is 
currently in /etc/rc with /usr/src/usr.bin/vi/install/recover.script, 
which I've included below.  If the script isn't used, then the following 
line in /etc/rc should be changed:

virecovery=/var/tmp/vi.recover/recover.*

should become

virecovery=`echo /var/tmp/vi.recover/recover.*`


--cut here--
#	@(#)recover.script	8.7 (Berkeley) 8/16/94
#
# Script to recover nvi edit sessions.
#
RECDIR=/var/tmp/vi.recover
SENDMAIL=/usr/sbin/sendmail
echo 'Recovering vi editor sessions.'

# Check editor backup files.
vibackup=`echo $RECDIR/vi.*`
if [ "$vibackup" != "$RECDIR/vi.*" ]; then
	for i in $vibackup; do
		# Only test files that are readable.
		if test ! -r $i; then
			continue
		fi

		# Unmodified nvi editor backup files either have the
		# execute bit set or are zero length.  Delete them.
		if test -x $i -o ! -s $i; then
			rm $i
		fi
	done
fi

# It is possible to get incomplete recovery files, if the editor crashes
# at the right time.
virecovery=`echo $RECDIR/recover.*`
if [ "$virecovery" != "$RECDIR/recover.*" ]; then
	for i in $virecovery; do
		# Only test files that are readable.
		if test ! -r $i; then
			continue
		fi

		# Delete any recovery files that are zero length, corrupted,
		# or that have no corresponding backup file.  Else send mail
		# to the user.
		recfile=`awk '/^X-vi-recover-path:/{print $2}' < $i`
		if test -n "$recfile" -a -s "$recfile"; then
			$SENDMAIL -t < $i
		else
			rm $i
		fi
	done
fi
-- 
Mike Pritchard
mpp@legarto.minn.net
"Go that way.  Really fast.  If something gets in your way, turn"



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199507021921.OAA01785>