From owner-freebsd-questions@FreeBSD.ORG Wed Jun 6 17:53:08 2007 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3CFA516A468 for ; Wed, 6 Jun 2007 17:53:08 +0000 (UTC) (envelope-from mnslinky@gmail.com) Received: from wa-out-1112.google.com (wa-out-1112.google.com [209.85.146.182]) by mx1.freebsd.org (Postfix) with ESMTP id 1386213C480 for ; Wed, 6 Jun 2007 17:53:07 +0000 (UTC) (envelope-from mnslinky@gmail.com) Received: by wa-out-1112.google.com with SMTP id j37so313880waf for ; Wed, 06 Jun 2007 10:53:07 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=Ug4iPpTFPG3uigemYqShrmCkeibojKeSKSLpku+s5L17EBlcwiDm/c406j0afX30dhUzewXuRrZCtVFk7B3G+V+WtoLFuWMusxjcghqE3o3Jv2C0wGfK2RWwkKhTbI0KTh4v9yp2IUz7pv45898AxM5ad/DYphxEQLvt2R1HYDQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=BmIPS0MAwOPuaH7YHh3L3OM1C0z75rsyrVvLoR0s9FIfQMPcQjHzTuCUfps4hGAbbH1JsFwkVGYQ8ulclc32p2apUzGewPYu0xccbOyzxQwani3eLHa2wJ9QCIqPFuOJxVNoTKpNrkdETuCAg4SBm9owWknv7eFK1sifQeuIpIk= Received: by 10.115.54.1 with SMTP id g1mr616813wak.1181152387555; Wed, 06 Jun 2007 10:53:07 -0700 (PDT) Received: by 10.114.204.1 with HTTP; Wed, 6 Jun 2007 10:53:07 -0700 (PDT) Message-ID: <905f1be0706061053p7ec00380q7864cced0b36543d@mail.gmail.com> Date: Wed, 6 Jun 2007 12:53:07 -0500 From: "Eric F Crist" To: "Zhang Weiwu" In-Reply-To: <20070607003640.28881437@eula> MIME-Version: 1.0 References: <1181141423.18606.91.camel@joe.realss.com> <905f1be0706060916u19f4c5coc8eb4b60521c8095@mail.gmail.com> <20070607003640.28881437@eula> Content-Type: text/plain; charset=ISO-2022-JP; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: freebsd-questions@freebsd.org Subject: Re: share my experience: highlight parts of a text file that matches a regular expression X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jun 2007 17:53:08 -0000 that worked great! thanks! On 6/6/07, Zhang Weiwu wrote: > > 于 Wed, 6 Jun 2007 11:16:17 -0500 > "Eric F Crist" 写道: > > > That's great! One question, how do I make it highlight the entire > > line, rather than the searched-for text? > > Guess would be: > $ my_app | grep --color=auto -e '.*regexp.*' -e '$' > > Add '.*' before and after your regular expression > > > > > Thanks! > > > > Eric Crist > > > > > > On 6/6/07, Zhang Weiwu wrote: > > > > > > Dear list > > > > > > I'd like to highlight part of output of one application that > > > matches a regular expression. First I thought this is simple: > > > > > > $ my_app | grep --color=auto 'regexp' > > > > > > This method have a big problem that lines doesn't match regexp is > > > not displayed, in my case I want all output of my_app being > > > displayed, only the matching part highlighted. > > > > > > First I thought grep might have a parameter to output everything it > > > receive, and it seems it doesn't. And I discovered I can use '-e' > > > parameter for this purpose: > > > > > > $ my_app | grep --color=auto -e 'regexp' -e '$' > > > > > > The second -e makes all line matched. > > > > > > Maybe useful for some newbies. > > > -- > > > Zhang Weiwu > > > Real Softservice > > > http://www.realss.com > > > +86 592 2091112 > > > > > > _______________________________________________ > > > freebsd-questions@freebsd.org mailing list > > > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > > > To unsubscribe, send any mail to " > > > freebsd-questions-unsubscribe@freebsd.org" > > > > > _______________________________________________ > > freebsd-questions@freebsd.org mailing list > > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > > To unsubscribe, send any mail to > > "freebsd-questions-unsubscribe@freebsd.org" >