help-cfengine
[Top][All Lists]
Advanced

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

quoting and parentheses in ExecResult?


From: Steve Wray
Subject: quoting and parentheses in ExecResult?
Date: Mon, 15 Aug 2005 10:29:34 +1200
User-agent: Mozilla Thunderbird 0.9 (X11/20041103)

In trying to use ExecResult to do some manipulation of lists, I found
some interesting and unexpected results.

The variable in this example:

someresult = ( ExecResult(/bin/sh "/bin/echo baz|/bin/sed -e
\"s/^\(.*\)$/&.conf/g\"") )

is set to:

<$/&.conf/g\"")>

Thats delimited with the angle brackets for clarity.

I've tried various combinations of quoting and backslash-escaping here,
but its not working.


For reference, the original, commandline looks like this:
/bin/echo baz|sed -e "s/^\(.*\)$/&.conf/g"

My question, then, is how (apart from using an actual script in a file)
does one quote and escape such an expression to fit it into ExecResult?

I get the feeling that the problem is somehow in the way that cfengine
parses the parentheses, even though they are within double quotes,
passed to a shell.

-- 
"Politics is the art of looking for trouble, finding it, misdiagnosing
it, and then misapplying the wrong remedies." - Groucho Marx

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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