【发布时间】:2014-03-25 22:48:24
【问题描述】:
在 Ubuntu 上,我希望得到一个磁盘文件,内容如下:
foo $(bar)
我想使用cat 命令创建这个文件,例如
cat <<EOF > baz.txt
type_magic_incantation_here_that_will_produce_foo_$(bar)
EOF
问题在于美元符号。我尝试了多种反斜杠、单引号和双引号字符的组合,但无法正常工作。
【问题讨论】:
标签: bash shell unix escaping sh