From owner-freebsd-hackers Mon Jan 22 17:56:38 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id RAA13289 for hackers-outgoing; Mon, 22 Jan 1996 17:56:38 -0800 (PST) Received: from localhost.cdrom.com (localhost.cdrom.com [127.0.0.1]) by freefall.freebsd.org (8.7.3/8.7.3) with SMTP id RAA13283 Mon, 22 Jan 1996 17:56:34 -0800 (PST) Message-Id: <199601230156.RAA13283@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: Host localhost.cdrom.com [127.0.0.1] didn't use HELO protocol To: Josh MacDonald cc: Warner Losh , Wolfram Schneider , hackers@freebsd.org Subject: Re: recursive grep In-reply-to: Your message of "Mon, 22 Jan 1996 17:31:37 PST." <199601230131.RAA11361@paris.CS.Berkeley.EDU> Date: Mon, 22 Jan 1996 17:56:34 -0800 From: "Justin T. Gibbs" Sender: owner-hackers@freebsd.org Precedence: bulk >> : I would like add options for recursive searching >> : (grep -R foo /usr/include). >> >> find /usr/local | xargs grep foo >> >> Why do we need another wart on grep? Especially when what you may >> want is find /usr/local -name \*f.h | xargs grep foo :-) >> >> Warner > >and why do we need an extra pipe, either? > > find /usr/include -name \*f.h -exec grep foo {} /dev/null \; Warner's example execs grep once (actually #files / xargs file limit). Your example execs grep for each file. Even though our pipe bandwidth isn't the best, I'd rather use a pipe then exec grep a bazillion time -- Justin T. Gibbs =========================================== FreeBSD: Turning PCs into workstations ===========================================