Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: priority problem of ":|" and ":*"
- X-seq: zsh-users 17496
- From: Han Pingtian <hanpt@xxxxxxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Re: priority problem of ":|" and ":*"
- Date: Wed, 26 Dec 2012 07:11:33 +0800
- In-reply-to: <20121224105241.GA24051@localhost.localdomain>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <20121224105241.GA24051@localhost.localdomain>
On Mon, Dec 24, 2012 at 06:52:41PM +0800, Han Pingtian wrote:
> hi,
>
> I believe the new ":|" and ":*" should be in Rule 7 Modifiers of
> paramter expansion, so this looks like a problem in priority:
>
> % a1=(a b c);a2=('a b c');print "${a1:|a2}"
>
> % a1=(a b c);a2=('a b c');print "${#a1:|a2}"
> 3
>
> in this, the priority should be "5 Double-quoted joining" first, then "7
> modifiers", then "9 length". So 'print "${#a1:|a2}"' should output 0 I
> think. And the ":*" has the same problem.
>
For the ":*", we have this result:
% a1=(a b c);a2=(a b c);print ${a1:*a2}
a b c
% a1=(a b c);a2=(a b c);print "${a1:*a2}"
% a1=(a b c);a2=(a b c);print "${#a1:*a2}"
3
%
Messages sorted by:
Reverse Date,
Date,
Thread,
Author