bug-cfengine
[Top][All Lists]
Advanced

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

empty macros


From: David Kewley
Subject: empty macros
Date: Thu, 29 Apr 2004 21:59:08 -0700
User-agent: KMail/1.5

Try this script in cfengine 2.1.5:

    #!/usr/sbin/cfagent -f

    control:

        IfElapsed = ( 0 )

        empty = ( "" )

        slashdot = ( "/." )

        test = ( "$(empty)hello" )

        actionsequence = ( copy links shellcommands )

    copy:

        $(slashdot)/etc/fstab

                dest=/tmp/fstab-1

        $(empty)/etc/fstab

                dest=/tmp/fstab-2

        /etc/fstab$(empty)

                dest=/tmp/fstab-3

        /etc/fstab

                dest=$(empty)/tmp/fstab-4

    links:

        $(empty)/etc/fstab ->! /tmp/fstab-5

        /etc/fstab ->! $(empty)/tmp/fstab-6

    shellcommands:

        "/bin/echo $(test)"

The result:

1) cfagent prints: cfengine::/bin/echo hello: hello
2) /tmp/fstab-{1,3,4} are copies of /etc/fstab
3) /tmp/fstab-(2,5,6) are never created, and there is no error message 
printed

In sum, there are rather inconsistent results when using an empty macro.

David





reply via email to

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