cmp.is

Force Zsh File Redirection

0 Comments

I get an error from zsh when I try to redirect to a file that exists. Simply add a ! to the > to force it.

echo "new text" >! overwrite.file

According to this StackOverflow post you could also set noclobber to clobber, but I’m okay with the other answer which keeps the protection.


Any issues or suggestions? Tell me on github.

0 Comments