I have a simple script to search patterns in my code sources, named prgrep
#!/usr/bin/bash
grep -irnI --exclude-dir={.git,obj} --exclude=tags --color=auto "$@"
(The fact that it is a script and not an alias or function is that I want to be able to call it from inside vim and with any shell)
Note that the search is case insensitive (since I consider this a good default to search) and the script accepts any flags that grep accepts.
I would like grep to have a flag --no-ignore-case so that the caller of the script could override the -i flag of the script, but GNU grep does not provide this.
Do you have any simple idea to provide such functionality? Currently I have a separate script named Prgrep which performs case sensitive searches.
EDIT
Recent versions of GNU grep do provide a --no-ignore-case option, which is exactly what I need. I'm using GNU grep 3.1, which still doesn't have this option.
$1for any string you like and create a case statement with or without case-sensitive search.-i- I don't understand what the question is.grepoptions