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 02:22:52PM -0500, Greg Troxel wrote:
> 
> One of the git tests fails.  I have reduced the failure to a small test
> case:
...
> p="--foo --bar"
> func alt "alt ${p:+$p}"

Yes that should only generate one parameter.
The 'problem' is cause because the internal expansion of $p
isn't actually quoted, "$alt ${p:+"$p"}" is needed for that.
Not being quoted means it should be subject to things like filename
globbing.  (someone is going to tell me that is wrong!)(

IIRC the only quoted expansion that can generate multiple parameters
is "$@".

        David

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


Home | Main Index | Thread Index | Old Index