diff options
author | Chet Ramey <chet.ramey@case.edu> | 2014-02-26 09:36:43 -0500 |
---|---|---|
committer | Chet Ramey <chet.ramey@case.edu> | 2014-02-26 09:36:43 -0500 |
commit | ac50fbac377e32b98d2de396f016ea81e8ee9961 (patch) | |
tree | f71882366b98fedf1a88a063103219a4935de926 /tests/dollar-star7.sub | |
parent | 4539d736f1aff232857a854fd2a68df0c98d9f34 (diff) | |
download | bash-ac50fbac377e32b98d2de396f016ea81e8ee9961.tar.gz |
Bash-4.3 distribution sources and documentationbash-4.3
Diffstat (limited to 'tests/dollar-star7.sub')
-rw-r--r-- | tests/dollar-star7.sub | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/dollar-star7.sub b/tests/dollar-star7.sub new file mode 100644 index 00000000..72d6c24f --- /dev/null +++ b/tests/dollar-star7.sub @@ -0,0 +1,30 @@ +# if IFS side effects in ${IFS=} assignments take place, how do you cope with +# later changes to IFS in the same set of expansions? You've already +# committed to using the first character of the (old) IFS to expand $* in +# the previous expansions, and changing it to not include ' ', for instance, +# results in the first couple of ${*} below not being split at all + +set -f -- a b c + +unset -v IFS +printf '<%s> ' ${*}${IFS=}${*}${IFS:=-}"${*}" +echo +printf "after 1: IFS " +echo "${IFS-unset}" +recho "$*" + +set -f -- a 'b c' d +unset -v IFS +printf '<%s> ' ${*}${IFS=}${*}${IFS:=-}"${*}" +echo +printf "after 2: IFS " +echo "${IFS-unset}" +recho "$*" + +unset -v IFS +recho $* +recho "$*" + +IFS=' ' +recho $* +recho "$*" |