Which of the following characters can be combined with a separator string in order to read from the current input source until the separator string, which is on a separate line and without any trailing spaces, is reached?

A.

<<

B.

<|

C.

!<

D.

&<

题解

使用「<<」可以自定义结束输入的字符串。举例来说:

cat << EOF > text.txt

紧接着输入:

Line 1
Line 2
Line 3
EOF

当输入「EOF」的时候,cat 就会结束运行,并且把之前输入的三行文字输出到「text.txt」文件中。

所以「text.txt」文件的内容是:

Line 1
Line 2
Line 3