console parameter value with dollar becomes interpolation

14 views
Skip to first unread message

João Matos

unread,
Feb 17, 2017, 11:40:57 AM2/17/17
to Puppet Users
Hi all

we're trying to assign a value to a parameter with a dollar and that is a problem.
adding a backslash only makes the string become backslashed which is not what we want. Different types of quoting did seem to work either..
I'm sure a lot of people add this issue but i couldnt find an answer on search engines or this group.

Any solution or simply not allowed?

tks!

jcbollinger

unread,
Feb 20, 2017, 8:51:49 AM2/20/17
to Puppet Users
The Puppet documentation describes the format for string literals.  There are multiple ways to produce a string value that contains a '$' character, but we cannot easily make any specific recommendations to you because you have not presented the problematic Puppet code.  I'm inclined to guess that in your attempts to find a solution by trial & error, you made offsetting changes, and so missed finding a solution.

It its simplest, if you want to avoid interpolation being performed then using single quotes instead of double quotes to delimit your string is a good option:

$variable = 'I am assigned to $variable'

If that does not solve your problem then we need more information before we can suggest a more suitable implementation.


John

Reply all
Reply to author
Forward
0 new messages