<< 的正确文本名称

me_*_*and 6 shell pipe

我刚刚遇到了<<命令,像这样使用:

cat > outfile.txt <<EOF
Multi-line content
that will be written to outfile.txt
EOF
Run Code Online (Sandbox Code Playgroud)

现在,我不知道它叫什么,但我很想知道它的名字,主要是这样我可以去搜索并了解更多关于它的语法。可悲的是,谷歌搜索“<<”是行不通的。

小智 18

这就是所谓的“此处文档”。

http://en.wikipedia.org/wiki/Here_document


Ign*_*ams 7

它被称为here documentheredoc。它将内容重定向到标准输入,直到到达关键字。

$ tac << EOT
> 123
> 456
> EOT
456
123
Run Code Online (Sandbox Code Playgroud)