help-cfengine
[Top][All Lists]
Advanced

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

RE: Pipes in ExecResult()


From: David E. Nelson
Subject: RE: Pipes in ExecResult()
Date: Mon, 30 Aug 2004 21:14:35 -0500 (CDT)


Hi Tim,

Sure thought that might have been it.

I still get syntax errors when I do 'cfagent -p -f ./cfagent.conf'. I'm using (all one line):

DefaultRouter = ExecResult(/bin/netstat -rn | /bin/grep UG | /bin/awk '{ print $2 }')

I even tried escaping the curly braces w/o any success.

Regards,
         /\/elson


On Mon, 30 Aug 2004, Cole, Tim wrote:


Nelson,

See below!

Hi All,

I'm trying the following to determine the default gateway for Solaris
and
Linux
boxes:

control:

DefaultGateway = ExecResult(/bin/netstat -rn | grep UG | awk '{ print
$2
}')

Every command in your pipe chain must have the full path!!!

DefaultGateway = ExecResult(/bin/netstat -rn | /bin/grep UG | /bin/awk
'{ print $2}')



and I'm getting syntax errors. If I use quotes, I get an error msg
stating
that
the path must be absolute. Do I need to write a module to do this?

Thanks,
         /\/elson

Cheers,



-------------------------------------------------------------------------------------
This e-mail is the exclusive, private and confidential property of the sender. 
The
information contained in it is intended solely for the use of the sender and the
intended recipient. If you are not the intended recipient you are hereby 
advised that
any unauthorized disclosure, copying, distribution or the taking of any action 
in
reliance on the contents of this message is strictly prohibited. If you have 
received
this e-mail in error, please notify us immediately by telephone (call the USF
Corporation Technical Support Center at 1-800-753-4563) and then destroy this
document and any copies in any form immediately.  Finally, the recipient should
check this email and any attachments for the presence of viruses. USF 
Corporation
accepts no liability for any damage caused by any virus transmitted by this 
email.
-------------------------------------------------------------------------------------


--
~~ ** ~~  If you didn't learn anything when you broke it the 1st ~~ ** ~~
                        time, then break it again.




reply via email to

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