相关疑难解决方法(0)

如何抑制bash heredocs中的变量替换

是否有可能创建一个不受变量扩展影响的heredoc?

例如

cat <<-EOF > somefile.sh
Do not print current value of $1 instead evaluate it later.
EOF
Run Code Online (Sandbox Code Playgroud)

更新 我知道逃避\.我的实际heredoc中有很多变量 - 它很容易出错并且很难逃脱所有这些变量.

syntax bash heredoc

6
推荐指数
1
解决办法
1268
查看次数

标签 统计

bash ×1

heredoc ×1

syntax ×1