Why not... grep -R -n ... and it's other options...?
Why rewrite as a 100+ lines of bash with multiple program invocations?
Why rewrite as a 100+ lines of bash with multiple program invocations?
An alias like alias xsearch="grep -rnw -e" would probably replace what you just built and I hope anyone able to install your script could at least figure out how to edit and source their .bashrc file.