help-cfengine
[Top][All Lists]
Advanced

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

RE: Using nawk with cfengine


From: Wheeler, John
Subject: RE: Using nawk with cfengine
Date: Thu, 17 Jun 2004 14:06:03 -0500

maybe ${dollar} is needed?

http://www.cfengine.org/docs/cfengine-Reference.html#Special%20variables

> -----Original Message-----
> From: help-cfengine-bounces+jwheeler=eb.com@gnu.org
[mailto:help-cfengine-
> bounces+jwheeler=eb.com@gnu.org] On Behalf Of DRANSUTAVICIUS, CLAUDIO
> Sent: Thursday, June 17, 2004 1:29 PM
> To: help-cfengine@gnu.org
> Subject: Using nawk with cfengine
> 
> 
> 
> Hello
> 
> I am trying to set up groups via domain name. The domainname is not
> set and I can only find it in /etc/resolv.conf .
> 
> Here is the code:
> 
> control:
>     FindDomain = ( ExecResult(/usr/bin/nawk '/domain/ { print toupper
> ($2) }' /etc/resolv.conf) )
> 
>     actionsequence = ( shellcommands  )
> 
> groups:
> 
>      West = ( Strcmp("WEST","${FindDomain}") )
> 
> shellcommands:
>         West::
>                               "/usr/bin/echo - This is the Western
> Domain $(FindDomain) "
>         East::
>                               "/usr/bin/echo - This is the Eastern
> Domain $(FindDomain) "
> 
> 
> The problem is when I try to convert from lower case to upper case in
> the nawk it fails.
> It does not like the ($2) cannot parse it properly.
> 
> Here is results:
> 
> /oss/opt/cfengine/bin/cfagent -q  -f NewTest.cf
> cfengine::/oss/var/cfengine/inputs/NewTest.cf:3: Warning: Redefinition
> of macro FindDomain=}' (or perhaps missing quote)
> cfengine::/oss/var/cfengine/inputs/NewTest.cf:3: Warning: Redefinition
> of macro FindDomain=/tmp/result) (or perhaps missing quote)
> 
> Any help would be great.
> 
> Thanks
> 
> 
> 
> 
> _______________________________________________
> Help-cfengine mailing list
> Help-cfengine@gnu.org
> http://lists.gnu.org/mailman/listinfo/help-cfengine





reply via email to

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