<<
的用法我不清楚,有人可以用一个简单的例子解释一下吗?真的很感激。
最佳答案
cat <<'EOF'
hello $$
I'm a here document that doesn't interpolate
any $-variables because of the qutoes around
the EOF marker
EOF
echo -------
cat <<EOF
hello $$
I'm a here document that does interpolate
EOF
echo -------
cat <<x
It doesn't matter what you use as the end of file marker
x
echo -------
cat <<'x'
Quotes prevent $-interpolation
x
输出:
hello $$
I'm a here document that doesn't interpolate
any $-variables because of the qutoes around
the EOF marker
-------
hello 29843
I'm a here document that does interpolate
-------
It doesn't matter what you use as the end of file marker
-------
Quotes prevent $-interpolation
关于linux - 我不清楚一个重定向运算符,那就是 <<,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38885511/