The reason
grep -ei foo -ei bar -ei baz
does not work is because the semantics for the -e
option is -e PATTERN
, as in
grep -i -e foo -e bar -e baz
... which is what the command should have looked like. The -i
option (for case insensitive matching) will only need to be specified once and will affect all patterns.
With -ei foo
you ask grep
to look for the pattern i
in the file foo
.
The "broken pipe" error comes from pip3
trying to write to the end of a dead pipe. The pipe is dead because grep
could not find the files foo
, bar
or baz
, and terminated (with three "file not found" errors). The traceback is from pip3
which is a Python program (so it tells you exactly where in the Python code the fault happened on its side).
grep -ie foo -e bar -e baz
, no? the expressions should follow the-e
pip3 list | grep -ei
- you're askinggrep
to find all lines matchingi
i
ande
matters (becausei
is just a switch, wherease
expects an argument)-e
must be last and also why-i
is needed only once, while-e
is needed for every pattern. Good answer.