Hi Vadim,
I used following:
(the $string uses <double><single> .... <single><double> quotes
[johan@zbook ~]$ cat test.pp
$string = "'a quoted string'"
exec { 'show string':
command => "echo \"I want to see ${string}\"",
logoutput => true,
path => '/bin:/usr/bin',
}
[johan@zbook ~]$ puppet apply test.pp
Notice: Compiled catalog for zbook.koewacht.net in environment production in
0.06 seconds
Notice: /Stage[main]/Main/Exec[show string]/returns: I want to see 'a quoted
string'
Notice: /Stage[main]/Main/Exec[show string]/returns: executed successfully
Notice: Applied catalog in 0.06 seconds
-----Original message-----
From: Vadym Chepkov <[email protected]>
Sent: Sunday 13th December 2015 17:20
To: Puppet Users <[email protected]>
Subject: [Puppet Users] How to include quoted string into a command
Hi,
I can't figure out how to include a single quoted string into a command, not
matter what escaping I do.
Here is a simplified code :
$string = '\'a quoted string\''
exec { 'show string':
command => "echo \'I want to see ${string}\'",
logoutput => true,
path => '/bin:/usr/bin',
}
Quotes don't show up, no matter what.
What do I do wrong?
$ puppet --version
3.6.2 (Puppet Enterprise 3.3.2)
Thanks,
Vadym
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected]
<mailto:[email protected]> .
To view this discussion on the web visit
https://groups.google.com/d/msgid/puppet-users/923ff9af-4321-4dee-a7b9-8002a1204042%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/puppet-users/zarafa.566e9210.4d81.231b159c69c0d5ff%40zarafa.open-future.be.
For more options, visit https://groups.google.com/d/optout.