Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
How should empty aliases work?
- X-seq: zsh-workers 42182
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: How should empty aliases work?
- Date: Fri, 29 Dec 2017 00:30:31 -0800
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=mime-version:from:date:message-id:subject:to; bh=pAxQhCwnTrXjQZ/whuWa7Og18gD9LcuF/nEInZ6C/xY=; b=Pl5ufJWjM4zwJKBU48sJVkO1bKj+YbIHWSm6NBFvLJFf/xfJ8coQJF6IM26qyTm5J9 EvrGuHZ+5Pu5HvDngNbyk/ds0atkCeu8N4YklvDI5OuaZGa5rg3UuxdxOZDxOcmLd6Iq /Mba8TC4hbMuUXHz4guR+3mUuUP9zZ2dZNq395nudq2DCOwqDRm8Bv7pCGtsswS5aZ8t UlQIJfLkWURi59HET8NuuNhg5zmKp9v1ueDi7vIg6v8A2S6bJ7n73HYEmdtARmM3DEYC bOEoAK8oOMZpKHeGuveBr9FoGajCtX1Nu96EEolPxftOp3f27LkAp4UT295mcTTZHxiA 1GPw==
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
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