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

Re: Strange parsing bug(?)



On Oct 1,  2:56am, Richard Hartmann wrote:
}
} Of course, I might have stumbled onto a hidden feature, but if that
} is the case, I would argue that this is extremely against the
} expectation of most users.

It's not a hidden feature, but it is a feature.  Doc says:

   If the shell encounters the character sequence `!"' in the input,
   the history mechanism is temporarily disabled until the current list
   (see *Note Shell Grammar::) is fully parsed. The `!"' is removed
   from the input, and any subsequent `!' characters have no special
   significance.

If you don't want ! to be a history character, setopt nobanghist.  If
you do want it to be a history character, then ... get used to using
single quotes instead of double, I guess, because history doesn't
expand in single quotes.

(Aside:  I think it's actually the first character of $histchars and
then a double quote that has this effect, so the doc could be better.)



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