For /bin/sh -c "/usr/bin/python -c \"import asdf\"" Use the backticks /bin/sh -c `"/usr/bin/python -c \"import asdf\""` And I am not sure your quotes are what you need....the back ticks will go a long way toward helping your problem
Mark Wolf UNIX/Linux System Administrator Choose Linux or.... Choose Two: Good, Fast, or Cheap! -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of christian pearce Sent: Tuesday, January 31, 2006 11:55 AM To: Mark Burgess Cc: help-cfengine@gnu.org Subject: Re: pre-2.1.15 -> 2.1.18 upgrade warning On 1/31/06, Mark Burgess <[EMAIL PROTECTED]> wrote: > > I'm not sure if it helps, but the version is a class string... True, that will work. > Also, don't stick to the release versions. Always see what has been > fixed in the patches > > > On Tue, 2006-01-31 at 13:55 -0500, christian pearce wrote: > > Brendan, > > > > Are you stuck with broken configs at this point? I am faced with the > > same quandry. I am at 2.1.15 but my code is not compatible with > > 2.1.18. And last I checked when I tried to fixed the code to work > > with 2.1.18 it won't work under 2.1.15. What are you doing to get > > around this? > > > > On 1/31/06, Brendan Strejcek <[EMAIL PROTECTED]> wrote: > > > 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/ > > > > > > > > > _______________________________________________ > > > Help-cfengine mailing list > > > Help-cfengine@gnu.org > > > http://lists.gnu.org/mailman/listinfo/help-cfengine > > > > > > > > > -- > > Christian Pearce > > > > > > _______________________________________________ > > Help-cfengine mailing list > > Help-cfengine@gnu.org > > http://lists.gnu.org/mailman/listinfo/help-cfengine > > -- Christian Pearce _______________________________________________ Help-cfengine mailing list Help-cfengine@gnu.org http://lists.gnu.org/mailman/listinfo/help-cfengine _______________________________________________ Help-cfengine mailing list Help-cfengine@gnu.org http://lists.gnu.org/mailman/listinfo/help-cfengine