I was able to solve this problem with the
following:
control:
openBrace = ( "{" )
closeBrace = ( "}" )
shellcommand:
openBrace = ( "{" )
closeBrace = ( "}" )
shellcommand:
"/bin/ps axo
\"stime,pid,command\" | /bin/awk ' ${openBrace} print $2 ; ${closeBrace} '
"
not sure if this is the most graceful method but it
works!
Josh
From: Josh Hurd
Sent: Friday, February 10, 2006 1:30 PM
To: help-cfengine@gnu.org
Subject: Escape {} in shellcommnads?
I am trying to run a shellcommand that includes a call to awk. Awk requires the use of braces but CFE treats tham as variable substitutuions. I have tried escaping them with \ with no success. I've tried using single quotes and double quotes.
Here is a sample:
"/bin/ps axo \"stime,pid,command\" | /bin/awk ' {print $2 ;} '
"
The error returned is:
Incomplete variable syntax or bracket mismatch
Does anyone know how to pull this off? I don't want to deploy a one line shell script to all my clients.
Thanks!
Josh
_______________________________________________ Help-cfengine mailing list Help-cfengine@gnu.org http://lists.gnu.org/mailman/listinfo/help-cfengine