I love using the following pattern for searching in files:
grep --color=auto -iRnHr --include={*.js,*.html,} --exclude-dir={release,dev,} "span" .
I'd like, however, to have this one wrapped into a bash comand like this:
findinfiles {*.js,*.html,} {release,dev,} "span" // syntax is just a guessing
I cannot solve the problem of passing this kind of braces into a bash function and using them with $1
, $2
and so on. When I use the following:
function findinfiles() {
echo $1, $2, $3
}
Then:
me@pc ~> findinfiles {*.js,*.html,} {release,dev,} "span"
*.js, *.html, release
Ofc, passing arguments to grep won't work this way. It seems that arguments are indexed but not properly grouped.
Can anyone teach me how to deal with this kind of arguments?