[6654] in SIPB bug reports

home help back first fref pref prev next nref lref last post

Re: pmail / vi on Solaris

daemon@ATHENA.MIT.EDU (Albert Dvornik)
Fri Jan 16 07:07:06 1998

To: "Jacob Morzinski" <jmorzins@MIT.EDU>
Cc: bug-sipb@MIT.EDU
From: Albert Dvornik <bert@MIT.EDU>
In-Reply-To: "Jacob Morzinski"'s message of "Thu, 15 Jan 1998 21:43:53 EST"
Date: Fri, 16 Jan 1998 07:06:57 EST


"Jacob Morzinski" <jmorzins@MIT.EDU> writes:
> I tested vi for a while.  The problem is that pmail checks the
> exit status of vi, and Solaris vi returns a non-zero status very
> easily.  (The most common way to get one is to try a :s/foo/bar/
> where there is no match for "foo".  Each :s command like this
> increments the exit status by one.)

Yes, Solaris does that to both vi and ed, but doesn't document it in
the case of vi.  All hail Solaris!

> Even when the file was saved successfully, the non-zero status
> causes pmail to discard the result of the edits:
> [...]
> Perhaps we should clobber pmail, and force it to stop checking
> the return status of editors?

We could just punt checking, but a clever way to do this would be to
do what "crontab -e" does when it gets a non-zero exit status: it says

     The editor indicates that an error occurred while you were
     editing the crontab data - usually a minor typing error.

     Edit again, to ensure crontab information is intact (y/n)?
     ('n' will discard edits.)

If we wanted to be even more clever, we could check if the file was
changed by the edit and pop up two different messages depending...

--bert

home help back first fref pref prev next nref lref last post