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

查看:22
本文介绍了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天全站免登陆