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


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/


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