From owner-freebsd-questions Sat Sep 29 0:21:22 2001 Delivered-To: freebsd-questions@freebsd.org Received: from post.mail.nl.demon.net (post-11.mail.nl.demon.net [194.159.73.21]) by hub.freebsd.org (Postfix) with ESMTP id E572237B407 for ; Sat, 29 Sep 2001 00:17:53 -0700 (PDT) Received: from [212.238.77.116] (helo=buffy.raggedclown.net) by post.mail.nl.demon.net with esmtp (Exim 3.22 #1) id 15nENk-000LYh-00; Sat, 29 Sep 2001 07:17:52 +0000 Received: by buffy.raggedclown.net (Ragged Clown Mailhost, from userid 500) id 7A6ECBD67; Sat, 29 Sep 2001 01:42:58 +0200 (CEST) Date: Sat, 29 Sep 2001 01:42:58 +0200 From: Cliff Sarginson To: Mike Meyer Cc: questions@freebsd.org, bsd-freak@mbox.com.au Subject: Re: if then statement with grep Message-ID: <20010929014258.A8586@raggedclown.net> References: <25660940@toto.iv> <15284.52053.233409.459906@guru.mired.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.16i In-Reply-To: <15284.52053.233409.459906@guru.mired.org>; from mwm@mired.org on Fri, Sep 28, 2001 at 02:11:17PM -0500 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Fri, Sep 28, 2001 at 02:11:17PM -0500, Mike Meyer wrote: > Cliff Sarginson types: > > On Tue, Sep 25, 2001 at 09:03:14PM -0500, Conrad Sabatier wrote: > > > On 26-Sep-2001 Edwin Groothuis wrote: > > > > On Wed, Sep 26, 2001 at 10:56:43AM +1000, BSD Freak wrote: > > You can simplify even further if you ask grep nicely: > > grep -q "expected line" /var/log/myfile" && echo KISS > > This is even more efficient that the other solutions, as grep will > stop on the first match and exit with success. > >