tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: bug in sh, probably, with test case



On Thu, Dec 20, 2012 at 03:20:42PM -0500, Richard Hansen wrote:
> 
>   "a${PWD+"*"}" also expands to the string a*, but interestingly it was 
> the string "a"*"" before the quote removal step (none of those double 
> quotes are themselves quoted according to the quoting rules, so they are 
> all eliminated during the quote removal step)

I'm fairly sure netbsd's sh doesn't expand that like that.
IIRC the inner string is expanded separately with its own quoting (starting
with no quotes). The unwanted 'ability' to generate multiple tokens
probably comes from the necessity of expanding "$@".

I think expanding "a${PWD+'*'}" should give a*, not the a'*' you'd get
from quote removal of "a'*'".

There is probably a nice simple apparrant 'fix' that makes something
else break 'big time'.

        David

-- 
David Laight: david%l8s.co.uk@localhost


Home | Main Index | Thread Index | Old Index