On 6/21/17 2:43 PM, Kevin Brodsky wrote: > That is also my reading of POSIX (and that's more or less what Bash's > manpage says as well), but it doesn't seem to be the case (even in <=4.2):
That's a relatively new requirement. The portion of the relevant sentence that reads "initially producing one field for each positional parameter that is set" is new as of issue 7 TC2. Without that, the splitting rules for $* were effectively identical whether it was quoted or not quoted -- they were separated using the first character of $IFS. In a context where they were not quoted and word splitting took place, this had the side effect of splitting them in an unquoted context. When IFS is null, that resulted in no splitting. There were long discussions on the Posix list about this starting in late 2014, resulting in Posix interp 888. http://austingroupbugs.net/view.php?id=888 There are still some cases where I haven't completely made bash conform to the new spec. > > $ set -- 'a b' > $ IFS='' > $ nb_args $* > 1 > $ nb_args $@ > 1 This is a different situation: when IFS is null, there is no splitting. So N fields are produced, one for each of N positional parameters, but they are not split any further. -- ``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/