News for hackers. Stuff that matters.
Re:Filenames and Pathnames in Shell: How to Do It Correctly by js2 on Tuesday June 20, 2023 @10:11AM (#36404248)
There's quite a few situations where it does NOT exit when you'd expect it to. This is one of those. What you're seeing there is a variant of the "Short-Circuiting Considerations" discussed here:

http://redsymbol.net/articles/unofficial-bash-strict-mode/

Basically, when you short circuit, it will not cause the script to exit. However, the short circuit still affects the return value of the function, or the script itself if it's the last line of the script.

So your short circuit is causing the function to return non-zero, which then causes the script to exit.

There are no comments on this comment yet.