1 # first, let's start with the basics
13 # If IFS is null, the parameters are joined without separators
17 # If IFS is unset, the parameters are separated by spaces
25 set bob 'tom dick harry' joe
32 set bob 'tom dick harry' joe
39 set bob 'tom dick harry' joe
46 set bob 'tom dick harry' joe
53 # according to POSIX.2, unquoted $* should expand to multiple words if
54 # $IFS is null, just like unquoted $@
56 set bob 'tom dick harry' joe
63 set bob 'tom dick harry' joe
70 # if IFS is unset, the individual positional parameters are split on
71 # " \t\n" if $* or $@ are unquoted
73 set bob 'tom dick harry' joe
80 set bob 'tom dick harry' joe
87 # but not for "$@" or "$*"
88 set bob 'tom dick harry' joe
95 set bob 'tom dick harry' joe
102 # POSIX.2 says these should both expand the positional parameters
109 # this example is straight from the POSIX.2 rationale
124 set -- 1 2 3 4 5 6 7 8 9 10
143 eval foo3='$*' bar3='${*}'
186 eval foo3='$*' bar3='${*}'
210 # tests for the effect of quoting $* and $@ in an assignment context (plus
211 # arrays) -- bugs through bash 4.2
212 ${THIS_SH} ./dollar-at-star1.sub
214 # tests for special expansion of "$*" and "${array[*]}" when used with other
215 # expansions -- bugs through bash-2.05b
216 ${THIS_SH} ./dollar-star1.sub
218 # tests for expansion of "$@" on rhs of things like ${param:+word}. Bugs
220 ${THIS_SH} ./dollar-at1.sub
222 # tests for expansion of other variables in double-quoted strings containing
223 # $@. Bugs through bash-2.05b
224 ${THIS_SH} ./dollar-at2.sub
226 # tests for various expansions of $* in different contexts -- word split,
227 # no splitting, etc. when $IFS is NUL
228 ${THIS_SH} ./dollar-star2.sub
230 # tests for expansions of "${array[*]}" and "${array[@]}" when $IFS is not the
231 # default and the array contains null elements
232 ${THIS_SH} ./dollar-star3.sub
234 # test for set -u and expansions of $@ when there are no positional parameters
235 ${THIS_SH} ./dollar-at3.sub
236 # test for set -u and expansions of $* when there are no positional parameters
237 ${THIS_SH} ./dollar-star4.sub
239 # tests for expansions of $* when IFS is null
240 ${THIS_SH} ./dollar-star5.sub
242 # tests for inappropriate word splitting through bash-4.2
243 ${THIS_SH} ./dollar-at4.sub
245 # tests for problems with "$@" preceded and followed by other quoted expansions
247 ${THIS_SH} ./dollar-at5.sub
249 # tests for problems with "${@:1}" and other expansions with null entries
250 # in positional parameters
251 ${THIS_SH} ./dollar-at6.sub
253 # tests for expansions of $* when $1 == ""; problem through bash-4.2
254 ${THIS_SH} ./dollar-star6.sub
256 # tests for expansions of $* (unquoted) when IFS changes (e.g., ${IFS:=-})
257 # problem through bash-4.2
258 ${THIS_SH} ./dollar-star7.sub