Minor annoyance: update default egrep/fgrep aliases to not throw a deprecation warning

Fish shell.

These two aliases currently just add --color=auto to the commands they alias, but the commands themselves return fgrep: warning: fgrep is obsolescent; using grep -F (substitute egrep and -E for the other).

Since it is clearly redirecting to the other command anyway, there shouldn’t be any side effects of just updating them to alias fgrep=‘grep -F --color=auto’ and alias egrep=‘grep -E --color=auto’.

It seems to be pulled from /usr/share/cachyos-fish-config/cachyos-config.fish.

…and this is what you need:

alias egrep 'grep -E --color=auto'
alias fgrep 'grep -F --color=auto'
funcsave egrep fgrep

Wow .. thats like really old too.

egrep and fgrep, according to some quick search results, were deprecated back in 2007.

It seems for a while they had sort of back-compatible stubs in the form of, for example for /bin/egrep;

#!/bin/sh
exec grep -E "$@"

But even when those existed it would not make a whole lot of sense to consciously continue using egrep.

And the warning things began in 2022.

So yeah by any measure those lines should not exist .. at least in the form that they do .. and by any measure have been incorrect for years.

If we really want to support the invocations of the very old and dead egrep/fgrep then some example like those above from @dcog989 should be used.