Open bje- opened 6 years ago
grep -vE "string[1-5]|etc"
would by my preference.
Sure, even better.
@Dmole Let's say, for the sake of argument, that the regexes are unique and distinct and cannot be compacted like that. grep -v -e foo -e bar -e baz
grep -Ev "foo|bar|baz"
For new checks and feature suggestions
Here's a snippet or screenshot that shows the problem:
Here's what shellcheck currently says:
No issues detected.
Here's what I wanted or expected to see:
Shellcheck should suggest eliminating the long pipeline and replacing with a single command like
grep -v -e string1 -e string2 -e string3 -e string4 -e string5
.