Re: Cfengine Help: Re: how to redirect to /dev/null

2010-11-01 Thread Mark Burgess
If you need a shell, just add your own /bin/sh -c ... That way you can take responsibility yourself for the security implications. On 11/01/2010 10:39 PM, JIM AMANATIDIS, BLOOMBERG/ 731 LEXIN wrote: > It would be a whole lot easier if returnszero just worked I think. > > - Original Message -

Re: Cfengine Help: Re: how to redirect to /dev/null

2010-11-01 Thread Wes Hardin
On 11/01/2010 04:21 PM, Jesse Becker wrote: > On Mon, Nov 01, 2010 at 03:10:27PM -0400, Daniel V. Klein wrote: >> Try using grep -q, it is much easier than redirecting > > But not portable. The -q option is a GNU extension. I don't know if maybe GNU had it first, but ‘-q’ is specified by POSIX (

Re: Cfengine Help: Re: how to redirect to /dev/null

2010-11-01 Thread Nicolas Charles
I'm not sure I understand what you are trying to achieve I think it would be : "Has_ce_nic" expression => returnszero("/bin/grep \"ce\" /etc/path_to_inst >/dev/null 2>&1 ", "useshell"); if you want to match ce or "Has_ce_nic" expression => returnszero("/bin/grep '\"ce\"' /tmp/path_to_inst >/dev/

Re: Cfengine Help: Re: how to redirect to /dev/null

2010-11-01 Thread JIM AMANATIDIS, BLOOMBERG/ 731 LEXIN
It would be a whole lot easier if returnszero just worked I think. - Original Message - From: Daniel V. Klein To: becker...@mail.nih.gov Cc: JIM AMANATIDIS (BLOOMBERG/ 731 LEXIN), help-cfengine@cfengine.org At: 11/01 17:38:57 You could always try -s :-) On Nov 1, 2010, at 5:21 PM, Jesse

Re: Cfengine Help: Re: how to redirect to /dev/null

2010-11-01 Thread Daniel V. Klein
You could always try -s :-) On Nov 1, 2010, at 5:21 PM, Jesse Becker wrote: > On Mon, Nov 01, 2010 at 03:10:27PM -0400, Daniel V. Klein wrote: >> Try using grep -q, it is much easier than redirecting > > But not portable. The -q option is a GNU extension. > > [je...@titan:~]$ uname -a > SunOS

Re: Cfengine Help: Re: how to redirect to /dev/null

2010-11-01 Thread Jesse Becker
On Mon, Nov 01, 2010 at 03:10:27PM -0400, Daniel V. Klein wrote: >Try using grep -q, it is much easier than redirecting But not portable. The -q option is a GNU extension. [je...@titan:~]$ uname -a SunOS kronos 5.10 Generic_142900-08 sun4u sparc SUNW,Sun-Fire-V240 [je...@titan:~]$ grep -q foo t

Re: Cfengine Help: Re: how to redirect to /dev/null

2010-11-01 Thread Daniel V. Klein
Try using grep -q, it is much easier than redirecting On Nov 1, 2010, at 3:07 PM, JIM AMANATIDIS, BLOOMBERG/ 731 LEXIN wrote: > > Okay, this seems to break with the string being searched is wrapped in > quotes, regardless of how many "\" surround it to escape it: > > classes: >"Has_ce_nic