Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: zsh question



On Sat, 27 Nov 1999, Bob Glickstein wrote:

> Hi Bart.  I use "setopt NOCLOBBER," so that I have to append a ! to >
> and >> when the destination file exists.  What I'd really like is an
> option that requires a ! only for > and not for >>.  Is there one?

Just to be sure there's no confusion: NOCLOBBER means > requires a ! when
the file exists, and >> needs a ! when the file does NOT exist.  This is a
csh-ism.  Also: >| and >>| are equivalent to >! and >>!.

No, there's no option to change this.  There's HIST_ALLOW_CLOBBER, which
causes > and >> to be entered into the history as >| and >>|, so that if
you immediately do !! (or C-p RET) the redirection gets forced.  That may
not work inside emacs if shell-mode decides to interpret the !! for you;
I've never been sure exactly when it does that ("Using history item: 7").



Messages sorted by: Reverse Date, Date, Thread, Author