Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have simple script like this:



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

Yet it outputs into file:

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

how to make cat use my variables values, not names inside that string?

share|improve this question

Drop the single quotes around the here-document limit string EOF to avoid suppressing parameter substitution. More details here.

Especially take note of "Example 19-7. Parameter substitution turned off" and "Example 19-8. A script that generates another script".

share|improve this answer
@sukminder, thank you. Will keep this in mind going forward – iruvar Oct 11 '13 at 20:19

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.