Hello Andrew, I'm forwarding your message on to the full Austin Group.

On Sun, Dec 10, 2023 at 11:37:40PM -0500, Andrew L. Moore wrote:
> Hi,
> I am the author of the original GNU ed and maintain an alternative (and I
> might add, much more robust) version at github.com/slewsys/ed.
> 
> One thing that I'd love to see the POSIX committee explore is the exit
> status of ed.  Per the standard:
> 
> EXIT STATUS
> 
>     The following exit values shall be returned:
> 
>      0.  Successful completion without any file or command errors.
>      >0.  An error occurred.
> 
> The problem with this behavior is that, in interactive use, it common to
> make errors, correct them and then write the corrected file.  But by exiting
> with an error, even after successfully writing, this prevents ed from being
> used as the editor for many utilties, which abort when the editor exits with
> a non-zero error code.
> 
> In the version of GNU ed handed over to Antonio, the behavior was that after
> a successful write, the error status is reset to zero.  This had no impact
> on traditional scripting and merely allowed ed to be much more friendly,
> e.g., for writing git commits. Unfortunately, Antonio updated GNU ed at some
> point to follow POSIX, which is sub-optimal.
> -AM
> 

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.
Virtualization:  qemu.org | libguestfs.org

Reply via email to