Using IFS with echo [duplicate]

三世轮回 提交于 2020-01-16 11:13:06

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!