help-cfengine
[Top][All Lists]
Advanced

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

Re: getting a solid result from an ExecResult...


From: Doug Nordwall
Subject: Re: getting a solid result from an ExecResult...
Date: Thu, 05 Sep 2002 09:12:15 -0700

thanks!! very nice, it works :)

On Thursday, September 5, 2002, at 09:00 AM, Adrian Phillips wrote:

"Doug" == Doug Nordwall <doug@pnl.gov> writes:

    Doug> I'm trying to do the following myVar = (ExecResult
    Doug> (/bin/grep astring ${myFile}) )

    Doug> Now, this does return the result, save that the grep finds 3
    Doug> instances, and it appears that cfengine ignores the \n's on
    Doug> the end and strings all the results together. Fine, I say,
    Doug> to myself , I'll work around it, so I do things like

    Doug> myVar1 = (ExecResult (/bin/grep astring ${myFile} |
    Doug> /usr/bin/head -1) ) myVar2 = (ExecResult (/bin/grep astring
    Doug> ${myFile} | /usr/bin/head - 2 | /usr/bin/tail -1) )

    Doug> Oddly, the second line seems to break cfengine.  None of
    Doug> them appear to work correctly.

    Doug> Has anyone gotten something like this to work?

try :-

 ExecResult (/bin/sh -c "command | command")

Sincerely,

Adrian Phillips

--
Your mouse has moved.
Windows NT must be restarted for the change to take effect.
Reboot now?  [OK]





reply via email to

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