[Top][All Lists]

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

Re: file edit

From: Adrian Phillips
Subject: Re: file edit
Date: 06 Feb 2002 11:08:26 +0100
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1

>>>>> "Daniel" == Daniel Nilsson <> writes:

    Daniel> Hi!

    Daniel> Im trying to get cfengine to edit one file if another file
    Daniel> contains a specific word.

    Daniel> I tried with the following code, but it doesnt work...

    Daniel> editfiles:

    Daniel>         solaris::

    Daniel>         { /etc/mail/
    Daniel> BeginGroupIfNoLineContaining "null-Client v0.1"
    Daniel> DefineClasses sendmail_edit EndGroup }

    Daniel>         sendmail_edit.solaris:: { /usr/lib/mail/cf/
    Daniel> AutoCreate EmptyEntireFilePlease AppendIfNoSuchLine
    Daniel> "VERSIONID(`null-Client v0.1')" AppendIfNoSuchLine
    Daniel> "OSTYPE(`solaris2')" AppendIfNoSuchLine
    Daniel> "FEATURE(`nullclient',`' )"
    Daniel> AppendIfNoSuchLine "MASQUERADE_AS(`my.domain')"
    Daniel> DefineClasses "m4_run" DefineClasses "sendmail_restart" }

another way to do this :-

        doit = ( '/bin/grep -q "This is my text" file' )

                { whatever



Adrian Phillips

Your mouse has moved.
Windows NT must be restarted for the change to take effect.
Reboot now?  [OK]

reply via email to

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