4 ms·
That seems to be zsh-specific syntax that is like ">" except that overrides a CLOBBER setting[1]. However, it won't work in bash. It will create file named "!"
by adrianmonk 3y ago
That seems to be zsh-specific syntax that is like ">" except that overrides a CLOBBER setting[1].
However, it won't work in bash. It will create file named "!" with the same contents as "filename". It is equivalent to "cat /dev/null filename > !". (Bash lets you put the redirection almost anywhere, including between one argument and another.)
---
[1] See https://zsh.sourceforge.io/Doc/Release/Redirection.html https://zsh.sourceforge.io/Doc/Release/Redirection.html
- pdimitar 3y agoYikes, then I have remembered wrong about bash, thank you. In that case I'll just always use `truncate -s0` then. Safest option to remember without having to carry around context about which shell is running the script, it seems.