是否有可能创建一个不受变量扩展影响的heredoc?
例如
cat <<-EOF > somefile.sh Do not print current value of $1 instead evaluate it later. EOF
更新 我知道逃避\.我的实际heredoc中有很多变量 - 它很容易出错并且很难逃脱所有这些变量.
\
syntax bash heredoc
bash ×1
heredoc ×1
syntax ×1