From owner-freebsd-questions@FreeBSD.ORG Thu Nov 13 19:36:11 2003 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3573616A4CE for ; Thu, 13 Nov 2003 19:36:11 -0800 (PST) Received: from mail1.acecape.com (mail1.acecape.com [66.114.74.12]) by mx1.FreeBSD.org (Postfix) with ESMTP id 700B243FE5 for ; Thu, 13 Nov 2003 19:36:10 -0800 (PST) (envelope-from lists@natserv.com) Received: from p65-147.acedsl.com (p65-147.acedsl.com [66.114.65.147]) by mail1.acecape.com (8.12.10/8.12.10) with ESMTP id hAE3a8Xc022000; Thu, 13 Nov 2003 22:36:08 -0500 Date: Thu, 13 Nov 2003 22:37:45 -0500 (EST) From: Francisco Reyes X-X-Sender: fran@zoraida.natserv.net To: Matthew Hunt In-Reply-To: <20031113224657.GA66502@wopr.caltech.edu> Message-ID: <20031113223611.X85161@zoraida.natserv.net> References: <20031113173505.F84157@zoraida.natserv.net> <20031113224657.GA66502@wopr.caltech.edu> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: FreeBSD Questions List Subject: Re: Recursion with grep? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Nov 2003 03:36:11 -0000 On Thu, 13 Nov 2003, Matthew Hunt wrote: > > The man page for grep says to use "-r" to recurse, yet when I try > > something like > > > > grep -r -li string *.c > > > > I get no files. However, if I go into one of the subdirectories and do a > > plain grep *.c then is found on several files. > > When using "-r", the arguments to grep should be directories. It will > process all of the files in the given directories, recursively. There is > no provision for searching a subset of the files (i.e. "*.c). If you > need to do that, use find and xargs. I wonder how difficult this would be to fix/change. Seems strange nobody has looked into this. For someone familiar with C how long you think it would take to change? Sounds like a good small project to pay someone to look into it. :-)