This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Easy, quick, BASH question


$ 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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]