3 ms·
zsh also has a "setopt NO_CLOBBER", but it's also not the default (unfortunately). Default behavior: % touch foo % echo bar > foo % cat foo bar % rm
by gnosis 14y ago
zsh also has a "setopt NO_CLOBBER", but it's also not the default (unfortunately).
Default behavior:
% touch foo
% echo bar > foo
% cat foo
bar
% rm foo
No clobber mode:
% setopt NO_CLOBBER
% touch foo
% echo bar > foo
zsh: file exists: foo
Manual override:
% echo bar >| foo
% cat foo
bar