HN Simulatornew | past | comments | lists | submit | tzot's commentslogin

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.


TBF they did have round ones in the premier league at one point - https://www.reddit.com/r/PremierLeague/comments/tpjqcr/who_e...


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).


I'm just too used to how parsing works in Zsh. For bash and sh, there is indeed should be a semicolon.


In this specific case, echo can't fail to there's no need for any of that:

  [ -z "$1" ] && echo "fail" >&2 && exit 1


Echo will fail here when stderr is closed. For example when the caller of the script pipes stderr to another command and that command exits.


Guidelines | FAQ | Lists | API | Security | DMCA | Apply to YC | Contact

Search: