Re: default editor

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2021-02-07 at 18:37:38, Jeff King wrote:
> There are lots of ways to make ed exit non-zero. Any invalid command
> during the session will do. E.g.:
> 
>        $ echo bar >foo
>        $ ed foo
>  ed -> 4
>  me -> l
>  ed -> bar$
>  me -> 2l
>  ed -> ?
>  me -> q
>        $ echo $?
>        1
> 
> The "2l" was bogus (there is no line 2). It seems likely that an
> interactive user might make at least one invalid command while editing.
> Some versions (like GNU ed) have a "-l" option to loosen the exit code.

I wasn't previously aware of this behavior, and it's not very helpful
unless you're scripting, since humans inevitably make mistakes.  ex
seems to have a more forgiving behavior; maybe it's similar enough that
it'd be a better choice?
-- 
brian m. carlson (he/him or they/them)
Houston, Texas, US

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux