Simply putting a shebang on the file doesn't fix the issue of importing a "cf.common" of some sort *before* running the script in question. The quickie bash script that Brendan suggests addresses that problem.

Paul Krizak                         5900 E. Ben White Blvd. MS 625
Advanced Micro Devices              Austin, TX  78741
Linux/Unix Systems Engineering      Phone: (512) 602-8775
Microprocessor Solutions Sector


Bruce Richardson wrote:
Roy Marantz <[EMAIL PROTECTED]> wrote:
I find that I can
        cat cf.common cf.stuff | cfagent -f -
but that seems wrong too.
Why? How about something like this:

    #!/bin/sh

    cat <<EOF | cfagent -qvf -
    import:
        cf.common
        cf.$1
    EOF

Amazing.  it works like a charm!  Thanks.  (now why didn't I think of that :-)

Why bother with any of that?  All you need to do is put a shebang at the
beginning of each file.  If each file starts with

#!/usr/sbin/cfagent -f

and you make the files executable, then you can execute each config file
individually whenever you want, or run cfagent against a config file
that imports the individual files (their shebang lines will be ignored).




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

Reply via email to