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

Re: aliases expanding aliases: a bug?



Jay Berkenbilt wrote:
> I just downloaded zsh 4.3.10, and I am able to reproduce this problem
> with that version.  It appears that if an alias ends with a space,
> arguments that themselves happen to be aliases are expanded, at least in
> some cases.

See zshmisc.  It's so you can do things like

  alias noglob="noglob "

and have aliases expanded after that.  People who regard "noglob" as
just a modifier might want alias expansion after it, others might not.

ALIASING
       Every  token  in the shell input is checked to see if there is an alias
       defined for it.  If so, it is replaced by the text of the alias  if  it
       is  in command position (if it could be the first word of a simple com-
       mand), or if the alias is global.  If the text ends with a  space,  the
       next  word  in  the shell input is treated as though it were in command
       position for purposes of alias expansion.  An alias  is  defined  using
       the alias builtin; global aliases may be defined using the -g option to
       that builtin.

pws



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