help-cfengine
[Top][All Lists]
Advanced

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

filter question/bug?


From: Roy Marantz
Subject: filter question/bug?
Date: 2 Nov 2001 18:42:22 -0000

I'm using version 1.6.3 on a Solaris 8 machine.  The executable was built
on a Solaris 7 machine.

I'm trying to use the ExecProgram filter without success.  What I did
was a variation on the example filter program (see below).  I've run
the execprogram manually and have seen the exit code/value change.
Does anyone have any ideas/clues?  Thanks.

What I really want to do is copy all the files in a directory
that match a some fixed pattern except for one which is know only at
run time. (i.e. is in a variable)

So I'd like to write:

    /etc action=alert r=1 include=hostname.*[0-9] exclude=hostname.$(a_int)

This fails because [0-9] isn't valid in a pattern :-( and there
doesn't seem to be a way to expand a variable in a pattern either.

I'm trying to get the following filter to work.

    { filter
      NameRegex:   ".*hostname\..+[0-9]"
      ExecProgram: "/bin/test  '$(this) = hostname.$(a_int)'"
      Result:    "ExecProgram.NameRegex"
    }
which should accomplish the same thing.

Roy

P.S.  I read everything on filters that I could find on the web site.
I've avoided delving into the source.

control:

             actionsequence = ( files shellcommands )
             AddInstallable = ( history )
             a_int = ( hme0 )

            files:

            /etc filter=filter2 action=alert r=1

            ##############################################

            filters:

              { filter2
          ExecProgram: "/bin/test  '$(this) = hostname.$(a_int)'"
          Result:    "ExecProgram"
              DefineClasses: "history"
              }

            #####################################

            shellcommands:

             history::

              "/bin/echo History was /dev/null"




reply via email to

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