From owner-freebsd-bugs@FreeBSD.ORG Mon Mar 7 17:40:05 2005 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5585816A4CE for ; Mon, 7 Mar 2005 17:40:05 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 147B343D39 for ; Mon, 7 Mar 2005 17:40:05 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.3/8.13.3) with ESMTP id j27He4qf092292 for ; Mon, 7 Mar 2005 17:40:04 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.3/8.13.1/Submit) id j27He40x092291; Mon, 7 Mar 2005 17:40:04 GMT (envelope-from gnats) Date: Mon, 7 Mar 2005 17:40:04 GMT Message-Id: <200503071740.j27He40x092291@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org From: Chris Hodgins Subject: Re: bin/78504: grep --exclude does not check directories ? X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Chris Hodgins List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Mar 2005 17:40:05 -0000 The following reply was made to PR bin/78504; it has been noted by GNATS. From: Chris Hodgins To: Charlie & Cc: FreeBSD-gnats-submit@freebsd.org Subject: Re: bin/78504: grep --exclude does not check directories ? Date: Mon, 07 Mar 2005 17:38:47 +0000 Charlie & wrote: >>Number: 78504 >>Category: bin >>Synopsis: grep --exclude does not check directories ? >>Confidential: no >>Severity: non-critical >>Priority: medium >>Responsible: freebsd-bugs >>State: open >>Quarter: >>Keywords: >>Date-Required: >>Class: sw-bug >>Submitter-Id: current-users >>Arrival-Date: Sun Mar 06 18:00:07 GMT 2005 >>Closed-Date: >>Last-Modified: >>Originator: Charlie & >>Release: FreeBSD 6.0-CURRENT i386 >>Organization: >>Environment: > > System: FreeBSD bang.freebsd.dk 6.0-CURRENT FreeBSD 6.0-CURRENT #2: Tue Feb 15 14:21:39 CET 2005 root@bang.freebsd.dk:/bang/p4/phk/phk_bufwork/sys/i386/compile/BANG i386 > > -current. > > >>Description: > > > # cat grep.sh > #!/bin/sh > > mkdir __ > cd __ > mkdir aaa > echo foo > a1 > echo foo > aaa/a1 > > set -x > grep -r --exclude=aaa foo . > # sh -x grep.sh > + grep -r --exclude=aaa foo . > ./aaa/a1:foo > ./a1:foo > > It doesn't seem possible to exclude directories when using > the -r(ecursive) option. > The man page states that the exclude flag is for skipping files and not directories. --exclude=PATTERN Recurse in directories skip file matching PATTERN. You can do what you want with the find command. find . \( -type d -name "aaa" -prune \) -o -print Chris > > >>How-To-Repeat: > > see above. > >>Fix: > > > > >>Release-Note: >>Audit-Trail: >>Unformatted: > > _______________________________________________ > freebsd-bugs@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-bugs > To unsubscribe, send any mail to "freebsd-bugs-unsubscribe@freebsd.org" >