Either way, I don’t see what the big deal is, just add an
alias egrep='grep -E'
If you’re worried about your non-interactive shell scripts, shopt -s expand_aliases; alias egrep='grep -E'
and you can move on with your life.EDIT: I must’ve been warned by shellcheck
EDIT2: here’s another one liner with one caveat being updates (also needs to be run as root)
# unalias grep && unalias egrep && cp "$(command -v grep)" "$(dirname "$(command -v grep)")/egrep"
EDIT3: just realized for most this will only ever come up in scripts because many distros already add alias egrep='grep -E' to your shell aliases (~/.bash_aliases, ~/.zshrc, etc). Thus you may only need the shopt -s expand_aliases.