[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: |
Tue, 22 Jun 2004 08:33:45 -0400 |
Hi Sven
Thanks for pointing me in the right direction. looks like the following
works.
/bin/grep -i ^domain.*west.ca /etc/resolv.conf
returns zero
/bin/grep -i ^domain.*unknown.ca /etc/resolv.conf
returns one
Sometimes you can not see the trees because of the forest.
Thanks again
T.J.
Sven Mueller wrote:
> DRANSUTAVICIUS, CLAUDIO schrieb:
>
> > How do I get around the fact that /etc/resolv.conf might not return the
> > domain
> > but the search criteria instead.
> >
> > Such as in /etc/resolv.conf
> >
> > domain west
> >
> > nameserver 112.102.148.230
> >
> > search west east west.ca east.ca
> >
> >
> > Any ideas.
>
> Not sure wether the following actually works in cfengine, but most grep
> implementations know regular expressions, so
>
> ReturnsZero(/bin/grep -e ^domain | /bin/grep -i west /etc/resolv.conf)
>
> might work. If your grep implementation (such as the gnu grep) allows
> both reg-expressions and case-insensitivity to be used at the same time,
> this might be a better alternative:
>
> West = ( ReturnsZero(/bin/grep -ie "^domain west" /etc/resolv.conf) )
> or
> West = ( ReturnsZero(/bin/grep -ie ^domain\ west /etc/resolv.conf) )
> or
> West = ( ReturnsZero(/bin/grep -i ^domain.*west /etc/resolv.conf) )
>
> I am not knowing cfengine all to well (again) by now, so this might or
> might not actually work. But it might give you an idea of what your
> could try.
>
> cu,
> sven
>
> --
> ---------------------[ Ciphire Signature ]----------------------
> From: sm@leogic.com signed email body (857 characters)
> Date: on 21 June 2004 at 21:10:08 GMT
> To: claudio.dransutavicius@bell.ca
> ----------------------------------------------------------------
> : The message above has been secured using Ciphire Mail.
> : Verify this signature and download your free encryption
> : software at www.ciphire.com. The three garbled lines
> : below are the sender's verifiable encoded signature.
> ----------------------------------------------------------------
> 00fAAAAAEAAACwTtdAWQMAAO4CAAIAAgACACA2A1N0anFAjhISsXqfspQ17ONB+Y
> 6A9ebgf4EvPUUdWwEAZ8hoc7VVY9dHDJGN9IMnlKpqZgaQgRfmZl6cjXlBQ48j5a
> c3mBISyTnF8uR4pSWsV2jIC38rzxP+xRKzxda/Pw==
> ------------------[ End Ciphire Signed Message ]----------------
- Using nawk with cfengine, DRANSUTAVICIUS, CLAUDIO, 2004/06/17
- RE: Using nawk with cfengine, Wheeler, John, 2004/06/17
- RE: Using nawk with cfengine, Wheeler, John, 2004/06/18
- RE: Using nawk with cfengine, Wheeler, John, 2004/06/18
- RE: Using nawk with cfengine, DRANSUTAVICIUS, CLAUDIO, 2004/06/21
- Message not available
- Re: Using nawk with cfengine,
DRANSUTAVICIUS, CLAUDIO <=