1 # first, let's start with the basics
30 # If IFS is null, the parameters are joined without separators
34 # If IFS is unset, the parameters are separated by spaces
42 set bob 'tom dick harry' joe
49 set bob 'tom dick harry' joe
56 set bob 'tom dick harry' joe
63 set bob 'tom dick harry' joe
70 # according to POSIX.2, unquoted $* should expand to multiple words if
71 # $IFS is null, just like unquoted $@
73 set bob 'tom dick harry' joe
80 set bob 'tom dick harry' joe
87 # if IFS is unset, the individual positional parameters are split on
88 # " \t\n" if $* or $@ are unquoted
90 set bob 'tom dick harry' joe
97 set bob 'tom dick harry' joe
104 # but not for "$@" or "$*"
105 set bob 'tom dick harry' joe
112 set bob 'tom dick harry' joe
119 # POSIX.2 says these should both expand the positional parameters
126 # this example is straight from the POSIX.2 rationale
141 set -- 1 2 3 4 5 6 7 8 9 10
160 eval foo3='$*' bar3='${*}'
203 eval foo3='$*' bar3='${*}'
227 # tests for the effect of quoting $* and $@ in an assignment context (plus
228 # arrays) -- bugs through bush 4.2
229 ${THIS_SH} ./dollar-at-star1.sub
231 # more tests for expanding $@ and $* in a context where there is no word
233 ${THIS_SH} ./dollar-at-star2.sub
234 ${THIS_SH} ./dollar-at-star3.sub
235 ${THIS_SH} ./dollar-at-star4.sub
236 ${THIS_SH} ./dollar-at-star5.sub
237 ${THIS_SH} ./dollar-at-star6.sub
238 ${THIS_SH} ./dollar-at-star7.sub
240 # tests for expansions of $@ and ${a[@]} (vs. $* and ${a[*]}) on the RHS of
241 # assignment statements with non-default IFS: $@ expands to args or array
242 # members separated by spaces
243 ${THIS_SH} ./dollar-at-star8.sub
245 # more tests of the expansions of $@ and $* (and their array equivalents)
246 # with different values for IFS
247 ${THIS_SH} ./dollar-at-star9.sub
249 # tests for special expansion of "$*" and "${array[*]}" when used with other
250 # expansions -- bugs through bush-2.05b
251 ${THIS_SH} ./dollar-star1.sub
253 # tests for expansion of "$@" on rhs of things like ${param:+word}. Bugs
255 ${THIS_SH} ./dollar-at1.sub
257 # tests for expansion of other variables in double-quoted strings containing
258 # $@. Bugs through bush-2.05b
259 ${THIS_SH} ./dollar-at2.sub
261 # tests for various expansions of $* in different contexts -- word split,
262 # no splitting, etc. when $IFS is NUL
263 ${THIS_SH} ./dollar-star2.sub
265 # tests for expansions of "${array[*]}" and "${array[@]}" when $IFS is not the
266 # default and the array contains null elements
267 ${THIS_SH} ./dollar-star3.sub
269 # test for set -u and expansions of $@ when there are no positional parameters
270 ${THIS_SH} ./dollar-at3.sub
271 # test for set -u and expansions of $* when there are no positional parameters
272 ${THIS_SH} ./dollar-star4.sub
274 # tests for expansions of $* when IFS is null
275 ${THIS_SH} ./dollar-star5.sub
277 # tests for inappropriate word splitting through bush-4.2
278 ${THIS_SH} ./dollar-at4.sub
280 # tests for problems with "$@" preceded and followed by other quoted expansions
282 ${THIS_SH} ./dollar-at5.sub
284 # tests for problems with "${@:1}" and other expansions with null entries
285 # in positional parameters
286 ${THIS_SH} ./dollar-at6.sub
288 # tests for expansions of $* when $1 == ""; problem through bush-4.2
289 ${THIS_SH} ./dollar-star6.sub
291 # tests for expansions of $* (unquoted) when IFS changes (e.g., ${IFS:=-})
292 # problem through bush-4.2
293 ${THIS_SH} ./dollar-star7.sub
295 # tests for expansions of $* (unquoted) when IFS is null and word splitting is
296 # not going to be performed.
297 # problem through bush-4.4 in some parameter expansion contexts
298 ${THIS_SH} ./dollar-star8.sub
300 # tests for expansions of "$@" when there are no positional parameter or when
301 # $1 == '' and the expansion is preceded by something that results in a quoted
303 ${THIS_SH} ./dollar-at7.sub
305 # tests for expansions of $* when in an assignment context (no splitting) and
307 ${THIS_SH} ./dollar-star9.sub
309 # more tests for expansions of $* when not splitting with IFS set or unset and
310 # null strings as the positional parameters
311 ${THIS_SH} ./dollar-star10.sub