| 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 |
| From: | "Stephen C. Biggs" <s_c_biggs AT bigfoot DOT com> |
| To: | "cygwin AT cygwin DOT com'" <cygwin AT cygwin DOT com> |
| Date: | Fri, 2 Aug 2002 19:11:01 -0700 |
| MIME-Version: | 1.0 |
| Subject: | Re: Easy, quick, BASH question |
| Message-ID: | <3D4AD945.16923.ADB067@localhost> |
| In-reply-to: | <C69F6A9E1E1F5A488C58B168F0875F4006B80CAB@riv-exch1.echostar.com> |
$ 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.
On 2 Aug 2002 at 16:04, Barnhart, Kevin wrote:
> 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 |