Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Keyword Aliasing Behaviour
- X-seq: zsh-users 10084
- From: "Sean B. Palmer" <sean@xxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Keyword Aliasing Behaviour
- Date: Sun, 26 Mar 2006 14:22:32 +0100
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=googlemail.com; h=received:message-id:date:from:sender:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=YplEHFRE4kt8WtbRXPbsibvvZ3IaiRb11+m/9LBIm1ptz6eHo5Z+5UKJN7hdxnp3h4S8S1c5XpRgz07Wq3B3Q8/EfQ5Y4S6dicfKM/2G5ydZrG72/w7/XJsFT3Giwuql+hPTkDaBiz6C2SUaCp5GvDdOT6QIVJ/f1pm/lffphVc=
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- Sender: sean.b.palmer@xxxxxxxxxxxxxx
Using zsh 4.2.6, I note that keywords can be aliased. For example:
alias in='test'
But then this gets expanded when the "in" keyword is used in a case:
$ case $HOME in *) :;; esac
zsh: parse error near `test'
I asked the #zsh IRC channel on Freenode, and a member there thought
it sounded like a bug and directed me to this mailing list. Can anyone
confirm that this is a bug, or is it a feature? If it's a bug, is it
fixed in a later version? If a feature, what is the rationale for it?
I notice that man zshall states that unless alias is provided with a
-g flag, making the alias global, the alias will only be expanded in a
command position. Since the "in" keyword in a case statement is not in
a command position, the behaviour I'm seeing appears to be erroneous.
The case $var { ... } syntax was suggested to me on #zsh, and is
useful but I probably shouldn't be rebinding keywords anyway.
Nevertheless, this was surprising behaviour.
Thanks,
--
Sean B. Palmer, http://inamidst.com/sbp/
Messages sorted by:
Reverse Date,
Date,
Thread,
Author