[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Setting a variable from a shellcommand
From: |
Martin A. Brooks |
Subject: |
Re: Setting a variable from a shellcommand |
Date: |
Tue, 21 Oct 2003 18:47:28 +0100 |
At 12:31 21/10/2003 -0500, you wrote:
I may be obtuse, but short of writing a module how can I set a cfengine
variable from the output of a shellcommand? I could have sworn I've seen
it done before, but I can't find it.
I want to do set a variable (call it $(my_ypserver)) to the output of the
/usr/bin/ypwhich command. A module seems like overkill for this....
I have a lot of lines like this:
FailoverKey = ( ExecResult(/bin/cat
/var/cfengine/inputs/keys/failover.pubkey) )
Seems to work fine, though I bet there's a more efficient way of doing it.
Regards
Martin A. Brooks, Clues Ltd.
http://www.clues.ltd.uk/