On 09-11-11 10:23, no-re...@cfengine.com wrote:
Forum: CFEngine Help
Subject: help with commands - append date to file
Author: matt_garman
Link to topic: https://cfengine.com/forum/read.php?3,23912,23912#msg-23912



Matt,

Your command must run in a shell, eg:


in_shell body is defined in cfengine_stdlib.cf


body common control
{
    inputs => {
        "cfengine_stdlib.cf"
    };

    bundlesequence => {
        test
    };
}

bundle agent test
{
    vars:
        "testfile" string => "/tmp/test_plain";

    files:
        "${testfile}" -> "Some Person",
            comment => "Make sure ${testfile} exists",
            create  => "true";

    commands:
        "/bin/date >> ${testfile}"
            contain    => in_shell,
            comment    => "Echo current date to our file";
}





--
********************************************************************
*  Bas van der Vlies                    e-mail: b...@sara.nl       *
*  SARA - Academic Computing Services   Amsterdam, The Netherlands *
********************************************************************

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

_______________________________________________
Help-cfengine mailing list
Help-cfengine@cfengine.org
https://cfengine.org/mailman/listinfo/help-cfengine

Reply via email to