我有这样的文字:
foo bar
`which which`
Run Code Online (Sandbox Code Playgroud)
如果我使用heredoc这样做,我得到一个空白文件:
? ~ echo <<EOT > out
heredoc> foo bar
heredoc> `which which`
heredoc> EOT
? ~ cat out
? ~
Run Code Online (Sandbox Code Playgroud)
我怎样才能做到这一点?
对不起,我打算做cat
.问题是它将它写入文件:which: shell built-in command
,即评估反推.没有评估,任何方式做到这一点?
有了cat
,我明白了
? ~ cat <<EOT > out
heredoc> foo bar
heredoc> `which which`
heredoc> EOT
? ~ cat out
foo bar
which: shell built-in command
? ~
Run Code Online (Sandbox Code Playgroud)
我不想which which
被评估.
dog*_*ane 36
引用标签以防止反引号被评估.
$ cat << "EOT" > out
foo bar
`which which`
EOT
$ cat out
foo bar
`which which`
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
3874 次 |
最近记录: |