Shell中 heredoc 内容转义 1、在$符号前面加反斜杠,如: cat > test.sh <<EOF $test EOF 如果不加,将转成实际的值。 2、给EOF加个双引号,如: cat > test.sh <<"EOF" $test EOF