Re: [Puppet Users] Re: How to include quoted string into a command

2015-12-15 Thread Vadym Chepkov
On Tuesday, December 15, 2015 at 5:48:36 PM UTC-5, Josh Cooper wrote: > > > Puppet is interpreting \` as an escape sequence since it's in a > double-quoted string, and reporting that it's an invalid escape sequence. I > think you'll need to escape the backslash: > > $string="/var/log/syslog -C

Re: [Puppet Users] Re: How to include quoted string into a command

2015-12-15 Thread Josh Cooper
On Tue, Dec 15, 2015 at 10:20 AM, Vadym Chepkov wrote: > Shell allows me to escape back-tick: > > $ echo "/var/log/syslog -C 8 -a 'kill -HUP \`cat /var/run/syslog.pid\`'" > /var/log/syslog -C 8 -a 'kill -HUP `cat /var/run/syslog.pid`' > > puppet does like them: > > $string="/var/log/syslog -C 8 -

[Puppet Users] Re: How to include quoted string into a command

2015-12-15 Thread Vadym Chepkov
Shell allows me to escape back-tick: $ echo "/var/log/syslog -C 8 -a 'kill -HUP \`cat /var/run/syslog.pid\`'" /var/log/syslog -C 8 -a 'kill -HUP `cat /var/run/syslog.pid`' puppet does like them: $string="/var/log/syslog -C 8 -a 'kill -HUP \`cat /var/run/syslog.pid\`'" exec{'echo string': comm

[Puppet Users] Re: How to include quoted string into a command

2015-12-15 Thread jcbollinger
On Monday, December 14, 2015 at 10:51:51 AM UTC-6, Vadym Chepkov wrote: > > I passed the single quotes bump, thank you, now I stuck on back ticks, > puppet actually calls the script it and doesn't allow me to escape ` symbol > > I need this for Solaris logadm.conf, which is a very unusual config

[Puppet Users] Re: How to include quoted string into a command

2015-12-14 Thread Vadym Chepkov
I passed the single quotes bump, thank you, now I stuck on back ticks, puppet actually calls the script it and doesn't allow me to escape ` symbol I need this for Solaris logadm.conf, which is a very unusual config file, since logadm modifies it during each run. I am using the same technique Pup

[Puppet Users] Re: How to include quoted string into a command

2015-12-14 Thread jcbollinger
On Sunday, December 13, 2015 at 10:20:00 AM UTC-6, Vadym Chepkov wrote: > > 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

[Puppet Users] Re: How to include quoted string into a command

2015-12-14 Thread Thomas Hallgren
Try this: command => "echo \"I want to see ${string}\"", i.e. send a double quoted string containing single quotes to the echo command rather than a single quoted string containing single quotes. HTH, - thomas On Sunday, December 13, 2015 at 5:20:00 PM UTC+1, Vadym Chepkov wrote: > > Hi, > > I