Unrecognised escape sequences

513 views
Skip to first unread message

mt321_0987

unread,
Feb 8, 2011, 10:09:51 AM2/8/11
to Puppet Users
unfortunately, we keep getting this warns into the system log by
puppet masters:

" [...] Unrecognised escape sequence '\<CHAR>' in file <PATH> [...] "

but then everything works fine; also, without using escapes, catalogs
dont work on agents.
What can we do to avoid these kind of errors in master syslogs?

Please ,let us know ASAP and tell us if this problem will prevent
remote execution in future versions, thanks

Greets,
Matteo

Felix Frank

unread,
Feb 9, 2011, 2:31:32 AM2/9/11
to puppet...@googlegroups.com

If you have strings that include backslashes, you should really escape
those backslashes, i.e.:

onlyif => "grep two\ words /tmp/file", # WRONG!

onlyif => "grep two\\ words /tmp/file", # right

In some cases, you can use single quotes instead

onlyif => 'grep two\ words /tmp/file', # right too

but you loose flexibility. I urge you to get your escapes right.

HTH,
Felix

M C

unread,
Feb 9, 2011, 6:13:36 AM2/9/11
to puppet...@googlegroups.com
Hi,

it aint our issue: we dont actually need to include escape chars into strings, our need is - for example - to escape delimitators ( ", ' ) inside command lines; in fact ,we're used to compose very complex tiny scripts with subshells for the 'command' field into 'exec' resources, etc..

Please help,
greets,
Matteo

2011/2/9 Felix Frank <felix...@alumni.tu-berlin.de>

--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To post to this group, send email to puppet...@googlegroups.com.
To unsubscribe from this group, send email to puppet-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.


Felix Frank

unread,
Feb 9, 2011, 6:38:52 AM2/9/11
to puppet...@googlegroups.com
On 02/09/2011 12:13 PM, M C wrote:
> Hi,
>
> it aint our issue: we dont actually need to include escape chars into
> strings, our need is - for example - to escape delimitators ( ", ' )
> inside command lines; in fact ,we're used to compose very complex tiny
> scripts with subshells for the 'command' field into 'exec' resources, etc..

My comment was not targeted at escaping specific characters. Whatever
you escape, if you want puppet to transfer a backslash to the client,
and the string containing that backslash is double-quoted in your
manifest, you should escape that backslash and avoid any ambiguity.

Regards,
Felix

M C

unread,
Feb 9, 2011, 7:22:02 AM2/9/11
to puppet...@googlegroups.com
Hi,

the problem we are facing is not the transfer of backslash escape+non-specific character; we need puppet not to log the warns into the syslog when catalogs are prepared and commands such as

command  =>  "/bin/echo \"\$(echo bin)\"",

are processed for compiling

Our syslogs are full of " [...] Unrecognised escape sequence '\<non-specific character>' [...] "

Please help, thanks
Greets,
Matteo

2011/2/9 Felix Frank <felix...@alumni.tu-berlin.de>
On 02/09/2011 12:13 PM, M C wrote:
Felix

Felix Frank

unread,
Feb 9, 2011, 8:03:37 AM2/9/11
to puppet...@googlegroups.com
On 02/09/2011 01:22 PM, M C wrote:
> Hi,
>
> the problem we are facing is not the transfer of backslash
> escape+non-specific character; we need puppet not to log the warns into
> the syslog when catalogs are prepared and commands such as
>
> command => "/bin/echo \"\$(echo bin)\"",
>
> are processed for compiling
>
> Our syslogs are full of " [...] Unrecognised escape sequence
> '\<non-specific character>' [...] "

The above line is giving you this warning? Please make double-sure.
There are lot of cases where this warning is justified, but the above
line should *not* generate it, as all of those sequences should be
recognized.

M C

unread,
Feb 9, 2011, 8:41:31 AM2/9/11
to puppet...@googlegroups.com
Hi,

thank you verymuch.

Matteo

2011/2/9 Felix Frank <felix...@alumni.tu-berlin.de>
On 02/09/2011 01:22 PM, M C wrote:
> Hi,
>

--
Reply all
Reply to author
Forward
0 new messages