Hi All,
I've got a script to output YAML data, and I want to display data that's held inside variables inside one large CAT area. What's the easiest way to do this?
cat << "END"
---
classes:
- general_image
- $intro #Variable 1
- $mid #Variable 2
- $doubled #Variable 3
parameters:
puppet_server: testing.huronhs.com
END
exit 0
I've tried referencing the variables this way, and tried using the backtick ` or brackets, but nothing exports the data held in the variables (just the string of "$intro" itself).
loose the quotes around END:
<< [-]word
The shell input is read up to a line that is the same
as word, or to an EOF. No parameter substitution, com-
mand substitution, or file name generation is per-
formed on word. The resulting document, called a
here-document, becomes the standard input. If any
character of word is quoted, no interpretation is
placed upon the characters of the document. Otherwise,
parameter and command substitution occur, \NEWLINE is
ignored, and \ must be used to quote the characters \,
$, `, and the first character of word. If - is
appended to <<, then all leading tabs are stripped
from word and from the document.
D'OH!
Why do I always do this to myself...
Thanks for the polite RTFM! Cheers!