help-cfengine
[Top][All Lists]
Advanced

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

exec help?


From: David C. Zemke
Subject: exec help?
Date: Thu, 13 Sep 2001 14:00:29 -0700 (PDT)

Several of the hosts that I administer have hostnames of the format

hostname[0-9][0-9]-blue.domain.com (e.g.  hawk12-blue.domain.com)

I'm trying to set a variable to the hostname minus everything from the
first digit to the end of the line (e.g. hawk12-blue.domain.com would just
be hawk)

I tried to do this:

hostname = ( "exec /bin/hostname | sed -e 's/[0-9].*//'" )

The above command works fine from the command line, but is not evaluated
properly by cfengine. Using the -v -d2 option, it looks like it evaluates
to the entire string in the above quotes (e.g. exec /bin/hostname |
sed...)

Is there a way to pipe commands together? just using 

hostname = ( "exec /bin/hostname" ) 

works fine, but it doesn't do what I need. I don't want to write a script
that it execs. 

So my question is, why doesn't this work, and how can I fix it?

Thanks in advance,


David Zemke . Systems Administrator . AuctionWatch.com . 650.808.5880
Ops Team -- Taking an "o" out of "oops".




reply via email to

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