问题
Why does this:
arr=(1 2 4 8 16)
IFS=,
echo "${arr[*]}"
print out 1,2,4,8,16
(which is what I want) but this doesn't:
arr=(1 2 4 8 16)
IFS=, echo "${arr[*]}"
?
I'd like to have a temporary IFS
without having to set it then reset/unset it.
来源:https://stackoverflow.com/questions/57627024/using-ifs-with-echo