[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Problems with ExecResult & ReturnsZero in 2.1.18
From: |
Kelly Craig |
Subject: |
Re: Problems with ExecResult & ReturnsZero in 2.1.18 |
Date: |
Thu, 29 Dec 2005 16:10:16 -0700 |
User-agent: |
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.12) Gecko/20050915 |
But, if you type it like this, you will also incure the wrath of CFENGINE!
:)
VarPart = ( ReturnsZero("/bin/sh -c \"df -l | grep \'^/dev\' | awk
\'{print $NF}\' | grep -q \'^/var$\'\"") )
You need to replace the quites like so.
VarPart = ( ReturnsZero('/bin/sh -c \'df -l | grep \'^/dev\' | awk
\'{print $NF}\' | grep -q \'^/var$\'\'') )
Brandon Evans wrote:
Mark Burgess wrote:
That's because the quotes disappear when they are not escaped.
So this works as it should
VarPart = ( ReturnsZero("/bin/sh -c \"df -l | grep \'^/dev\' | awk
\'{print $NF}\' | grep -q \'^/var$\'\"") )
Ahh very nice. I didnt try escaping evey quote within the command. I
just test this and verified that it does work on 2.1.18. The df -l
output is no longer being shown.
Thanks a lot for the help and all your hard work!
--
Kelly Craig
UCAR/NCAR
Earth Observing Laboratory
Systems Administration
FL1 - Rm. 2103
Ph: (303) 497-8825
Fx: (303) 497-2044
E-Mail: kcraig@ucar.edu
RE: Problems with ExecResult & ReturnsZero in 2.1.18, Martin, Jason H, 2005/12/29