When should you use
>| for redirecting output to a file instead of just
The explanation given when I was shown this was that it guaranteed the target file was truncated first. But I thought
> already implied that.
It's an explicit bypass of
That way, you can overwrite the file even with
man bash :
If the redirection operator is >, and the noclobber option to the set builtin has been enabled, the redirection will fail if the file whose name results from the expansion of word exists and is a regular file. If the redirection operator is >|, or the redirection operator is > and the noclobber option to the set builtin command is not enabled, the redirection is attempted even if the file named by word exists.