Thread (7 messages) flat view 7 messages, 6 authors, 2021-02-12

Re: default editor

From: brian m. carlson <hidden>
Date: 2021-02-07 19:10:41

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

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help