-
Notifications
You must be signed in to change notification settings - Fork 27
Description
Technically these are more matters of taste than bugs per se, but the following behaviors are cited as unpleasantly surprising in other shells (see https://mywiki.wooledge.org/BashFAQ/105):
In this example, imagine foo is actually a function defined somewhere far away in the script, not "intended" for use in a conditional; it may be unpleasantly surprising that the false there doesn't cause an exit (or throw an exception, with #73):
; let (fn foo {echo a; false; echo b})
if {foo} {
echo hmm
}
In this example, the following two commands are asymmetrical:
; echo `{echo a; false; echo b}
a b
; cat <{echo a; false; echo b}
a
The second case here is obviously disturbing. The first might not seem problematic, but it's called out as especially egregious in multiple places:
(This noticed when reading on elvish's error handling here.)
These might not be worth fixing in es today, but if #73 were merged, it might make sense to take the chance to include these fixes as well. Since I already imagine es -e is used vanishingly rarely, I don't think there's a huge backwards compatibility problem.