help-cfengine
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: pre-2.1.15 -> 2.1.18 upgrade warning


From: Brendan Strejcek
Subject: Re: pre-2.1.15 -> 2.1.18 upgrade warning
Date: Tue, 31 Jan 2006 10:34:09 -0600
User-agent: Mutt/1.5.6+20040818i

I'm still having issues with the quotation rules for ReturnsZero, though
I did find a workaround. I am trying to embed a command like:

    /bin/sh -c "/usr/bin/python -c \"import asdf\""

But I don't seem to be able to get the backslashes down to the shell. I
would expect this to work, escaping the backslashes, as it does in C:

    ReturnsZero("/bin/sh -c \"${python} -c \\\"import asdf\\\"\"")

But it does not. With an echo on the front, it seems clear that the parser
is not being greedy enough, as the output I get is:

    /usr/local/bin/python -c \

So it is throwing away everything after the underlined section:

    ReturnsZero("/bin/sh -c \"${python} -c \\\"import asdf\\\"\"")
                            ^^^^^^^^^^^^^^^^^^^

I did find that the following works:

    ReturnsZero("/bin/sh -c \"${python} -c ${quote}import asdf${quote}\"")

So maybe there is a bug with escaping backslashes.

I guess I will add a paragraph to my best practices document saying that
one should avoid complicated escaping. It is hard to read, anyways.

Best,
Brendan

--
Senior System Administrator
The University of Chicago
Department of Computer Science

http://www.cs.uchicago.edu/people/brendan
http://praksys.blogspot.com/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]