This is the mail archive of the
cygwin@cygwin.com
mailing list for the Cygwin project.
RE: Easy, quick, BASH question
- From: "Harig, Mark A." <maharig at idirect dot net>
- To: "Barnhart, Kevin" <Kevin dot Barnhart at echostar dot com>,<cygwin at cygwin dot com>
- Date: Fri, 2 Aug 2002 18:20:34 -0400
- Subject: RE: Easy, quick, BASH question
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.Barnhart@echostar.com]
> Sent: Friday, August 02, 2002 6:04 PM
> To: 'cygwin@cygwin.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/