From owner-freebsd-current@FreeBSD.ORG Thu Aug 19 20:22:57 2010 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 363DB1065674; Thu, 19 Aug 2010 20:22:57 +0000 (UTC) (envelope-from dimitry@andric.com) Received: from tensor.andric.com (cl-327.ede-01.nl.sixxs.net [IPv6:2001:7b8:2ff:146::2]) by mx1.freebsd.org (Postfix) with ESMTP id E89D48FC16; Thu, 19 Aug 2010 20:22:56 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7:0:18ec:2038:19e5:d1cb] (unknown [IPv6:2001:7b8:3a7:0:18ec:2038:19e5:d1cb]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id E3BC35C59; Thu, 19 Aug 2010 22:22:55 +0200 (CEST) Message-ID: <4C6D92A1.8030109@andric.com> Date: Thu, 19 Aug 2010 22:22:57 +0200 From: Dimitry Andric User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.2.9pre) Gecko/20100814 Lanikai/3.1.3pre MIME-Version: 1.0 To: David Xu References: <4C6505A4.9060203@FreeBSD.org> <20100814155346.GA6510@nagual.pp.ru> <4C66C0A4.3000301@FreeBSD.org> <4C6D5EF2.2040603@freebsd.org> In-Reply-To: <4C6D5EF2.2040603@freebsd.org> Content-Type: multipart/mixed; boundary="------------090409070507040103030506" Cc: delphij@freebsd.org, Gabor Kovesdan , current@freebsd.org Subject: Re: Official request: Please make GNU grep the default X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Aug 2010 20:22:57 -0000 This is a multi-part message in MIME format. --------------090409070507040103030506 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit On 2010-08-19 18:42, David Xu wrote: > When will the grep -H print file name for me ? it is rather painful > that the feature is missing. :-( > So I can not use it with find: > > find . -exec grep -H {} world \; > I don't know which file contains the word world. I think you mean: find . -exec grep -H world {} \; instead? In any case, the fix is trivial, please try the attachment. --------------090409070507040103030506 Content-Type: text/plain; name="bsdgrep-fix-H.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="bsdgrep-fix-H.diff" diff --git a/usr.bin/grep/grep.c b/usr.bin/grep/grep.c index 3cb277c..cc710ef 100644 --- a/usr.bin/grep/grep.c +++ b/usr.bin/grep/grep.c @@ -682,8 +682,6 @@ main(int argc, char *argv[]) if (dirbehave == DIR_RECURSE) c = grep_tree(aargv); else { - if (aargc == 1) - hflag = true; for (c = 0; aargc--; ++aargv) { if ((finclude || fexclude) && !file_matching(*aargv)) continue; --------------090409070507040103030506--