delorie.com/archives/browse.cgi | search |
Mailing-List: | contact cygwin-help AT cygwin DOT com; run by ezmlm |
List-Subscribe: | <mailto:cygwin-subscribe AT cygwin DOT com> |
List-Archive: | <http://sources.redhat.com/ml/cygwin/> |
List-Post: | <mailto:cygwin AT cygwin DOT com> |
List-Help: | <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs> |
Sender: | cygwin-owner AT cygwin DOT com |
Mail-Followup-To: | cygwin AT cygwin DOT com |
Delivered-To: | mailing list cygwin AT cygwin DOT com |
content-class: | urn:content-classes:message |
MIME-Version: | 1.0 |
Subject: | RE: Easy, quick, BASH question |
X-MimeOLE: | Produced By Microsoft Exchange V6.0.4417.0 |
Date: | Fri, 2 Aug 2002 18:20:34 -0400 |
Message-ID: | <BADF3C947A1BD54FBA75C70C241B0B9E10AA81@ex02.idirect.net> |
X-MS-Has-Attach: | |
X-MS-TNEF-Correlator: | |
From: | "Harig, Mark A." <maharig AT idirect DOT net> |
To: | "Barnhart, Kevin" <Kevin DOT Barnhart AT echostar DOT com>, <cygwin AT cygwin DOT com> |
X-MIME-Autoconverted: | from quoted-printable to 8bit by delorie.com id g72MKej32727 |
I don't know how to pass parameters to an alias. What about: hcgrep() { find . -iname "*.[ch]" -exec egrep -n $1 {} \;; } or hcgrep() { find . -iname "*.[ch]" | xargs egrep -n $1; } Also, consider installing and using 'ctags'. > -----Original Message----- > From: Barnhart, Kevin [mailto:Kevin DOT Barnhart AT echostar DOT com] > Sent: Friday, August 02, 2002 6:04 PM > To: 'cygwin AT cygwin DOT com' > Subject: Easy, quick, BASH question > > > I'm trying to setup an alias for grep that recursively looks > through all .c > and .h files for a string. So far I've tried variations of: > > alias hcgrep='grep -n "$*" $(find . -name '*.[ch]')' > > There's probably just one little thing I'm missing... > > Thanks, > Kevin > > -- > 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/ > > -- 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/
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |