如何使用cat将变量回显到文件中?


9

我有这样的简单脚本:

#!/bin/bash

BOO=bla-bla-bla

cat > ./Makefile <<'EOF'
        Hello
        INCLUDES := -I/data/opt/include/ -Ideps/ -I$BOO/include
EOF

但是它输出到文件中:

 Hello
 INCLUDES := -I/data/opt/include/ -Ideps/ -I$BOO/include

如何cat使用我的变量值,而不是该字符串中的名称?

Answers:


By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.