]>
Commit | Line | Data |
---|---|---|
ac50fbac CR |
1 | # if IFS side effects in ${IFS=} assignments take place, how do you cope with |
2 | # later changes to IFS in the same set of expansions? You've already | |
3 | # committed to using the first character of the (old) IFS to expand $* in | |
4 | # the previous expansions, and changing it to not include ' ', for instance, | |
5 | # results in the first couple of ${*} below not being split at all | |
6 | ||
7 | set -f -- a b c | |
8 | ||
9 | unset -v IFS | |
10 | printf '<%s> ' ${*}${IFS=}${*}${IFS:=-}"${*}" | |
11 | echo | |
12 | printf "after 1: IFS " | |
13 | echo "${IFS-unset}" | |
14 | recho "$*" | |
15 | ||
16 | set -f -- a 'b c' d | |
17 | unset -v IFS | |
18 | printf '<%s> ' ${*}${IFS=}${*}${IFS:=-}"${*}" | |
19 | echo | |
20 | printf "after 2: IFS " | |
21 | echo "${IFS-unset}" | |
22 | recho "$*" | |
23 | ||
24 | unset -v IFS | |
25 | recho $* | |
26 | recho "$*" | |
27 | ||
28 | IFS=' ' | |
29 | recho $* | |
30 | recho "$*" |