Skip to content

no-egrep

Shellstyleno fixdefault: offshell/shellcheck

Reports a call of egrep or fgrep.

They are obsolescent wrappers of grep -E and grep -F, and recent versions of GNU grep warn about them. They are not in every system.

To fix, write grep -E or grep -F.

Reported
...
egrep x f
fgrep x f
...
test -f x && echo yes || echo no
...
shell:
lint:
rules:
no-egrep: warn # off (default), warn, error

Enabled by the presets: shell/shellcheck.

Suppress one line with sudsy-disable-next-line no-egrep in a comment of the file’s language.

The same check in other tools; Sudsy reports what each upstream rule reports.

Tool Rule Match
shellcheck SC2196 full
shellcheck SC2197 full