Noo*_*tor 4 shell io-redirection cat here-document
Linux中的运算符<<
和<
用途是什么?
例如
cat << abc.txt
Run Code Online (Sandbox Code Playgroud)
<
用于重定向输入。说
command < file
Run Code Online (Sandbox Code Playgroud)
执行command
与file
作为输入。
该<<
语法被称为这里的文件。后面的字符串<<
是一个分隔符,指示此处文档的开始和结束。
$ cat abc.txt
cat: abc.txt: No such file or directory
$ cat << abc.txt
> Hello!
> Hey :)
> abc.txt
Hello!
Hey :)
$
Run Code Online (Sandbox Code Playgroud)
<<
不表示任何类型的间接。