On 2/24/17 3:20 PM, Grisha Levit wrote: > > > On Sat, Feb 18, 2017 at 8:35 PM, Martijn Dekker <mart...@inlv.org > <mailto:mart...@inlv.org>> wrote: >> >> When IFS is null, unquoted $* within an unquoted substitution (e.g. >> ${1+$*} or ${unset_var-$*}) joins the PPs together into one field, as if >> either "$*" or the whole substitution were quoted. >> >> POSIX says the unquoted substitution is supposed to generate one field >> for each positional parameter, with further field splitting inactive due >> to empty IFS.
If you want the expansion to be aware of the value of IFS and whether or field splitting will take place as a result, and I think that's the intent of the example, then the part of the description of $* that details what will happen when field splitting does not take place is active. That's where it describes joining the positional parameters into a single string. The question is whether it's the null IFS that's supposed to dictate whether field splitting will be performed, or the context of the expansion (e.g., whether it's on the RHS of an assignment statement). The description of $@ makes the distinction between context and effect, but the description of $* does not. This was the result of a long discussion in October, 2014 that resulted in Posix interpretation 888: http://austingroupbugs.net/view.php?id=888 You might be able to find the discussion in a mailing list archive somewhere. You might also want to send a message to the austin group and ask for a discussion concerning that specific case. Chet -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ``Ars longa, vita brevis'' - Hippocrates Chet Ramey, UTech, CWRU c...@case.edu http://cnswww.cns.cwru.edu/~chet/