Bash运算符<<<是什么? (即比符号少三倍)是什么意思? [英] What does the Bash operator <<< (i.e. triple less than sign) mean?

查看:120
本文介绍了Bash运算符<<<是什么? (即比符号少三倍)是什么意思?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

小于号的三重bash运算符<<<在下面的代码块中是什么意思?

What does the triple-less-than-sign bash operator, <<<, mean, as inside the following code block?

LINE="7.6.5.4"
IFS=. read -a ARRAY <<< "$LINE"
echo "$IFS"
echo "${ARRAY[@]}"

还有,为什么$IFS仍然是空格而不是句点?

Also, why does $IFS remain to be a space, not a period?

推荐答案

它将字符串重定向到命令的stdin.

It redirects the string to stdin of the command.

以这种方式直接在命令之前分配的变量仅在命令过程中生效;外壳保持不变.

Variables assigned directly before the command in this way only take effect for the command process; the shell remains untouched.

这篇关于Bash运算符&lt;&lt;&lt;是什么? (即比符号少三倍)是什么意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆