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

How should empty aliases work?



Documentation says that if an alias ends in a space, then the next
word is also subject to aliasing.

Consider:

% alias empty=''
% alias output='empty echo'
% alias echo='print -r bar'
% output foo

What should happen?  The doc would lead one to expect:
1. "output" expands to "empty echo"
2. "empty" expands to nothing
3. nothing does not end in a space, so the following word ("echo") is
not expanded
4. "echo foo" is executed

What actually happens is that "echo" expands and "print -r bar foo" is
executed.  If that's correct, can someone explain why?



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