Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Message-Id: <5.1.0.14.2.20020802194952.01f999f0@pop3.cris.com> X-Sender: rrschulz AT pop3 DOT cris DOT com Date: Fri, 02 Aug 2002 19:59:00 -0700 To: cygwin AT cygwin DOT com From: Randall R Schulz Subject: Re: Easy, quick, BASH question In-Reply-To: <3D4AD945.16923.ADB067@localhost> References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed Stephen, By using the "$PWD" argument, your suggestion will result in absolute path-names being generated and passed to grep. It's not a wrong or right issue, of course--in some circumstances that might be desirable, in others not. Also, by forking a separate process for each file, this approach generates pretty high overhead by comparison with the other suggestions that have been proffered. And again, the "$*" will not work correctly if more than one argument is given to this definition of "hcgrep." "$@" is the proper way to pass multiple, individually quoted options to the invocation(s) of grep. Randall Schulz Mountain View, CA USA At 19:11 2002-08-02, Stephen C. Biggs wrote: >$ function hcgrep()(find "$PWD" -name "*.[ch]" -type f -exec grep -n -H >"$*" {} \;) > >$ hcgrep include > >... works. > >According to the "man" page for bash, alias does not take arguments. -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/