5 ms·
If the shell were to treat cat as a builtin, could it implement cat| as a stdin redirect? I wish I could write "useless cat" without people pestering me about
by ufo 3y ago
If the shell were to treat cat as a builtin, could it implement cat| as a stdin redirect?
I wish I could write "useless cat" without people pestering me about it.
- kazinator 3y agoBash allows the $(< file) syntax instead of $(cat file), and I think the latter might be converted to the former.
- neuromanser 3y agoIt's built-in in Zsh: The substitution ‘$(cat foo)’ may be replaced by the faster ‘$(<foo)’. https://zsh.sourceforge.io/Doc/Release/Expansion.html#Command-Substitution https://zsh.sourceforge.io/Doc/Release/Expansion.html#Comman...
- ufo 3y agoIs that only for command substitution?
- neuromanser 3y agoWhat do you mean? It's specifically for $(cat …) / $(< …): the latter is a faster equivalent of the former. Other than that, see my comment about $READNULLCMD.