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

Re: Quoted parameter parsing glitch



On Aug 22,  8:21pm, Borsenkow Andrej wrote:
} Subject: RE: Quoted parameter parsing glitch
}
} > schaefer<502> print "${foo:-"}"
} > dquote braceparam>
} > 
} > At this point the parser is in an infinite loop.

I'm wrong, it's either more complicated than that example shows or it's
just me.  It's possible to get out of that one by just:

schaefer<502> print "${foo:-"}"
dquote braceparam> }
dquote> "
}


schaefer<503> 

I'm pretty sure I did manage to get it stuck on a more complicated
substitution, but my attempt to produce a minimal example went astray,
and I haven't reproduced whatever it was I first did.

} Shell should not hang, but please note it is invalid as per POSIX.
} Double-quotes and braces must match.

Zsh 4 (and ksh) is supposed to accept double-quotes inside ${...} inside
double-quotes; the braces act as an extra level of quoting so that the
inner quotes can nest in the outer ones.  I don't know what POSIX says
about that.

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