I am having a very difficult time getting the simplest shell
one-liners going within ExecShellResult. Here is an example:
prev_host = ( ExecShellResult(/bin/hostname -f | /bin/sed -n
's/\..*//p' | /bin/awk -F- '{print $1 "-" $2-1 }') )
I've found that I can't seem to have any form of a quote in there, and
the backslashing rules aren't very clear to me. So this works, but it
took me a very long time to get it working to that point:
prev_host = ( ExecShellResult(/bin/hostname -f | /bin/sed -n
s/\\..\*//p | /bin/awk -F- {print} ) )
BUT I can't get to the essential awk statement where I am adjusting
the names of the servers. In another statement I fiddle with IPs in a
similar way, and it all works via shell script, but it is all a silent
failure when inserted within ExecShellResult.
Similarly I am trying to set classes like this:
valid_host = ( ReturnsZero(/usr/bin/test -n "`/bin/hostname | /bin/sed
-n '/svr-.*[0-9]/p' `" ) )
Please help me get my one-liners working, or set me on a better path!
Brian McQueen
_______________________________________________
Help-cfengine mailing list
[email protected]
http://cfengine.org/mailman/listinfo/help-cfengine