简体   繁体   中英

What does “<<<” mean on a bash command line? And where is it documented?

What does <<< mean in this command line?

bc <<< "1 + 1"

It doesn't seem to a combination of < and << , and I can't find documentation for it. It seems to behave just like

echo "1 + 1" | bc

Also works in ksh , but not in sh .

It introduces a here string, documented near the end of the section on input and output redirections. A here string is just a one-word here document:

bc <<< "1 + 1"

is equivalent to

bc <<EOF
1 + 1
EOF

That is the here string operator. See here string operator document.

man ksh

您可以通过键入/(斜杠)后跟要搜索的内容(例如使用更少的程序)来在手册中执行搜索。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM