[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: ExecResult not working as expected
From: |
Kurt Lieber |
Subject: |
Re: ExecResult not working as expected |
Date: |
Fri, 26 Mar 2004 13:03:48 -0500 |
User-agent: |
Mutt/1.5.5.1i |
On Fri, Mar 26, 2004 at 06:54:32PM +0100 or thereabouts, Yves wrote:
> > cpu_info = ( ExecResult("/bin/cat /proc/cpuinfo | /bin/grep model\ name |
> > /bin/cut -d : -f 2 | /bin/uniq -c | /bin/sed
> > 's/\([0-9]\{1\}\)[[:space:]]\+\(.*\)/\1 x \2/'") )
>
> Hello Kurt,
>
> I think, there is a problem with "|" (pipe) symbol. Try this for example:
>
> value = ( ExecResult( /bin/ksh -c "comand | comand ..." )
Thanks for the suggestion -- I tried that with /bin/bash -c (since I don't
have ksh installed) but it didn't make a difference. Also, if it helps at
all, cfagent -f ./cf.rsync-mirror produces the following output:
cfengine::./cf.rsync-mirror:29: Warning: Redefinition of macro
cpu_info=[[:space:]]\+\(.*\)/\1 (or perhaps missing quote)
cfengine::./cf.rsync-mirror:29: Warning: Redefinition of macro cpu_info=x (or
perhaps missing quote)
cfengine::./cf.rsync-mirror:29: Warning: Redefinition of macro cpu_info=\2/'")
(or perhaps missing quote)
So I agree that the pipe symbol is probably the cause of the problem, but I'm
not sure how best to fix it.
--kurt
pgpMgLictUmRX.pgp
Description: PGP signature