Comment by kazinator
1 day ago
> : < missing.json; echo AFTER # <- this will not
This is required by POSIX in the section "Consequences of Shell Errors". If a redirection error occurs in a special built-in command, a non-interactive shell is required to exit.
The bare redirection without : does not have this problem:
< missing.json; echo AFTER
Therefore, in a POSIX-conforming shell, we do not need to wrap it in a subshell.
> but your message is factually wrong - on so many levels.
How many? Can you count the levels? I didn't know that in zsh "< file" dumps to standard output, which is suppressed by :. If I used Zsh, I would know that sort of thing.
No comments yet
Contribute on Hacker News ↗