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

Re: Possible bug with parameter expansion

On Thu, Mar 08, 2001 at 04:33:15PM +0000, Bart Schaefer wrote:

> 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*).

fair enough. Thanks.

> 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?

In ksh, there is no way I know of making var refer to an array because it
expands to the first element of the array and with [@], you get a bad

Comparing with bash, I have to use [@] to get an array before the
modifier. With the [@], both bash and zsh work the same regardless of
quotes. So basically, I haven't been able to create a comparable situation
in bash or ksh.

I still think the behaviour seems odd mainly because I'm used to reading
these substitutions from the inside out and the double quotes are on the


Messages sorted by: Reverse Date, Date, Thread, Author