News for hackers. Stuff that matters.
Re:A disk so full, it couldn't be restored by adrianmonk on Thursday April 04, 2024 @10:39AM (#39931008)
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

Re:A disk so full, it couldn't be restored by pdimitar on Thursday April 04, 2024 @02:03PM (#39933880)
Yikes, 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.