[Top][All Lists]

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

Re: Q: defining classes from shell command output

From: Avi Green
Subject: Re: Q: defining classes from shell command output
Date: Fri, 24 Aug 2001 15:02:27 -0400

> I'm trying to define a class using the out put of a shell command eg:
> control:
>          bits = ( "exec /usr/bin/isainfo -kv | cut -b1-2" )
>          addclasses  =  ( "$(bits)" )
> I get classes that are  the actual shell command  - not the
> output of the shell command.

In my experience, cfengine treats $(string) first checks to see whether
string is a variable name, and if so, it replaces $(string) with the
value of the variable, otherwise the output of treating string as a
command.  bits is a variable name, so $(bits) is replaced with "exec
/usr/bin/isainfo -kv | cut -b1-2".  I think maybe you should try this

           bits = ( "$(exec /usr/bin/isainfo -kv | cut -b1-2)" )


 = Avi Green :-) avi at (-: 212 217-1147 =
 ========  Unix SysAdmin & System Specialist  =========

reply via email to

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