help-cfengine
[Top][All Lists]
Advanced

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

Re: Using nawk with cfengine


From: DRANSUTAVICIUS, CLAUDIO
Subject: Re: Using nawk with cfengine
Date: Fri, 18 Jun 2004 09:00:00 -0400

Hi John

The trouble is  the open and close bracket of  ($2) not the actual
variable
$2
But may be I am wrong. Can you expand on the  ${dollar}  idea. I looked
on
the
link you provided but I am not to clear on this special variable.

Thanks

"Wheeler, John" wrote:

> maybe ${dollar} is needed?
>
> http://www.cfengine.org/docs/cfengine-Reference.html#Special%20variables
>
> > -----Original Message-----
> > From: address@hidden
> [mailto:help-cfengine-
> > address@hidden On Behalf Of DRANSUTAVICIUS, CLAUDIO
> > Sent: Thursday, June 17, 2004 1:29 PM
> > To: address@hidden
> > 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
> > address@hidden
> > http://lists.gnu.org/mailman/listinfo/help-cfengine





reply via email to

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