On Sun, Feb 12, 2006 at 08:26:17PM +0000, Peter Stephenson wrote: > Frankly, it's such a mess at the moment that I think any practical > improvement is a good thing. OK. Here's something even better. This appears to make us totally compatible with bash. I did the following: I added an extra arg to multsub() that lets the caller request that the string be split on unquoted whitespace (as defined by IFS) before being parsed. The code that handles ${...+...} uses this new flag, and then disables spbreak to prevent any further splitting. While I was at it, I fixed the comment for multsub() (it needed to be updated for when it returns an array vs a string). Because the docs say that using ${=foo} splits like SH_WORD_SPLIT, I made an explicit '=' work the same way (yeah, I'm waffling on this issue). For example: % set 1 '2 3 4' 5 '6 7' % for w in ${=1+"$@" 'extra words' 'and such here'}; echo $w 1 2 3 4 5 6 7 extra words and such here % for w in ${==1+more "$@" 'extra words' 'and such here'}; echo $w more 1 2 3 4 5 6 7 extra words and such here My checking for quoted whitespace currently honors Dnull, Snull, Tick, Inpar, and Outpar. Is that everything? Attached is the patch (which also includes the good changes from my last email). Let me know how you like it. ..wayne..