2 ms·
> This works because the `:` is a way to set a label, and it implicitly returns 0. It's just a weird wrinkle of the language. Do you have a source for that? I
by OJFord 3y ago
> This works because the `:` is a way to set a label, and it implicitly returns 0. It's just a weird wrinkle of the language.
Do you have a source for that? I thought it was just POSIX built-in for true. Like `.` vs. `source`. What's a label in this context anyway?
- cryptonector 3y agoNo need to ask for a source. The word "label" in the POSIX shell documentation only occurs in the description of `case`, and it doesn't happen in the manual page for bash, dash, zsh, etc.
- penguin_booze 3y agoEqually surprised. I know ':' is a label in sed, but labels in (ba)sh, I'm not aware. If it's indeed a label, is there a goto?
- VSpike 3y agoHah, yeah I was completely wrong on that! Should have fact checked myself. That's a falsehood I absorbed at some point and didn't question.