Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Possible bug with parameter expansion
- X-seq: zsh-workers 13593
- From: "Bart Schaefer" <schaefer@xxxxxxxxxxxxxxxxxxxxxxx>
- To: Oliver Kiddle <opk@xxxxxxxxxxxxx>, zsh-workers@xxxxxxxxxx
- Subject: Re: Possible bug with parameter expansion
- Date: Thu, 8 Mar 2001 16:33:15 +0000
- In-reply-to: <20010307113659.A13689@xxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <20010307113659.A13689@xxxxxxxxxxxxxxxxxx>
On Mar 7, 11:36am, Oliver Kiddle wrote:
} Subject: Possible bug with parameter expansion
}
} The ${name:#pattern} form of parameter expansion doesn't work within
} double quotes. It is acting as if the pattern matched all the elements.
If you read Peter's 11-step "summary of the rules for substitution" you
will see that (4. *Double-Quoted Joining*) comes before (6. *Modifiers*).
} % echo "${(M)a:#*=*}"
} a d=rt b=fg c e=yt
zagzig% echo "${(@M)a:#*=*}"
d=rt b=fg e=yt
} This looks like a bug to me because I can't see why the double quotes
} should be affecting the result.
Because they do. I don't recall why joining happens before modifiers,
but I'm pretty sure there was a good reason for it at the time. Does
this disagree with other shells that support ${var#pat}, e.g. ksh?
--
Bart Schaefer Brass Lantern Enterprises
http://www.well.com/user/barts http://www.brasslantern.com
Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net
Messages sorted by:
Reverse Date,
Date,
Thread,
Author