Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
嗨IFS=' '是空间,但什么是
IFS=' '
这意味着您正在指定IFS使用换行符进行拆分。这类似于执行以下操作:
IFS
IFS=$'\n'
不同之处在于您的方式符合 POSIX。
我的这个答案的来源是here和here
您可能会发现,根据您使用的 shell 实现,首选不同的方法(我认为这是正确的术语?)
注意:我的回答完全基于最后 10 分钟的研究,我没有这方面的经验或知识。