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