From owner-freebsd-questions@FreeBSD.ORG Fri Aug 8 04:33:19 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 80C0937B401 for ; Fri, 8 Aug 2003 04:33:19 -0700 (PDT) Received: from mail.sacbee.com (filter.sacbee.com [206.107.198.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id E2D6F43FB1 for ; Fri, 8 Aug 2003 04:33:16 -0700 (PDT) (envelope-from scoile@nandomedia.com) Received: by EXCHANGEMCC with Internet Mail Service (5.5.2653.19) id ; Fri, 8 Aug 2003 04:34:46 -0700 Received: from [10.1.1.45] (10.1.1.45 [10.1.1.45]) by exchangemcc.mcclatchy.com with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2653.13) id P88Y4QJ2; Fri, 8 Aug 2003 04:34:43 -0700 From: Steve Coile To: Ryan Thompson Date: Fri, 8 Aug 2003 07:30:49 -0400 (EDT) X-X-Sender: scoile@localhost.localdomain In-Reply-To: <20030807221210.F76742-100000@ren.sasknow.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-questions@freebsd.org Subject: Re: grep weirdness 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, 08 Aug 2003 11:33:19 -0000 On Thu, 7 Aug 2003, Ryan Thompson wrote: >doug@safeport.com wrote to freebsd-questions@freebsd.org: [...] >> artemis:~> grep -ilr taiwan * \ >> grep: unrecognized option `--showDropTarget' |____ does not work >> Usage: grep [OPTION]... PATTERN [FILE]... | >> Try `grep --help' for more information. / >> >> while > >Hmm... My guess is that * expands to something containing a leading >hyphen, most likely called --showDropTarget :-) The * is expanded by the >shell, not grep(1). If so, that's bad: the first non-option should disable further option processing. In the example cited, "taiwan" is not a command option, so anything to the right of "taiwan" should not be interpreted as a command option, even if it begins with a hyphen. This also suggests that grep is re-invoking itself as it recurses. If so, it should be an easy thing to patch the source so that a double hyphen ("--") occurs before the first argument. -- Steve Coile Systems Administrator Nando Media ph: 919-861-1200 fax: 919-861-1300 e-mail: sysadmins@nandomedia.com http://www.nandomedia.com