Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: