I remember SQLWindows of Gupta Technologies (later renamed to Team Developer of Centura Technologies IIRC) which had an outline IDE. Quoting from https://yagnipedia.com/wiki/sqlwindows :
> SQLWindows had an outline-based code structure — not braces, not BEGIN/END, but an indented tree that was simultaneously the code and the IDE’s display. You wrote code by expanding and collapsing outline nodes. Classes were outline headings. Methods were sub-headings. Code lines were leaf nodes. The entire program was a hierarchical outline that the IDE rendered as a collapsible tree.
And corporate UX/Design teams are eager to modernize those cards; yes they're already flat, but canary yellow is so last century and some glass effects or abolishing the rounded corners will be the next thing.
Do you have a real-world example where we would like to preserve `$?` after the `if` (which `if` specifically branches on the result code of the command it tests)? Where we want to use the actual return code that the `if` did not handle itself.
I am asking because I have never needed preserving the `$?` outside of an `if`, nor have I ever seen this in somebody else's scripts, and I'm curious.
I believe you missed a semicolon after `exit 1` and before `}`. `}` closes the opening `{` only at the start of a command (POSIX rules; don't remember now if bash recognizes it when it's just a command argument).
> SQLWindows had an outline-based code structure — not braces, not BEGIN/END, but an indented tree that was simultaneously the code and the IDE’s display. You wrote code by expanding and collapsing outline nodes. Classes were outline headings. Methods were sub-headings. Code lines were leaf nodes. The entire program was a hierarchical outline that the IDE rendered as a collapsible tree.