I have this as a bash function:
function gits() {
git grep -i -n --color $@ -- $(git rev-parse --show-toplevel);
}
If I run this:
gits def add_crumb
I want:
git grep -i -n --color "def add_crumb" -- $(git rev-parse --show-toplevel)
The purpose of $@
is specifically to split it into individual arguments. Use "$*"
if you don't want that. (Yes, with the double quotes; you should have them in "$@"
as well, actually.)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With