You’ve probably defined grep as an alias for grep --color=auto in your .bashrc, but that’s not loaded by scripts. Use an explicit grep --color in your script.
You’ve probably defined grep as an alias for grep --color=auto in your .bashrc, but that’s not loaded by scripts. Use an explicit grep --color in your script.