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

Re: zsh 2.6beta13 aliases quark



>After processing the following alias file, some of 1-letter aliases become 
>global. That is, "ls e" prints: emacs: no such file or directory. But "echo e"
>just prints e. Note that both "ls" and "e" are aliased
[...]
>alias ls="ls -aFC $LS_OPTIONS"
>alias e=emacs 

If $LS_OPTIONS is empty *when this alias command is executed*, the
expansion text of ls will end in whitespace which (deliberately, it's a
feature) will cause the next word on the line to be checked for alias
expansion.  What you really want is

alias ls='ls -aFC $LS_OPTIONS'

which makes the last character in the expansion text 'S', so you don't
get the alias problem, and it lets you change $LS_OPTIONS later.

-zefram



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