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

Re: priority problem of ":|" and ":*"



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