Bug 12721

Summary: grep does not implement -e pattern_lists currently
Product: Busybox Reporter: Hans Acker <bhcopnmeha>
Component: OtherAssignee: unassigned
Status: RESOLVED FIXED    
Severity: normal CC: busybox-cvs
Priority: P5    
Version: 1.31.x   
Target Milestone: ---   
Hardware: All   
OS: Linux   
Host: Target:
Build:

Description Hans Acker 2020-03-29 21:54:18 UTC
From `grep(1p)`:

  The pattern_list's value shall consist of one or more patterns separated by <newline> characters;

Consider the following invocation:

  printf "foo\nbar\nbaz\n" | grep -Fv -e "$(printf "foo\nbar\n")"

In accordance with the POSIX man page this should output the following:

  baz

This is what GNU grep (for instance) outputs. The busybox implementation outputs:

  foo
  bar
  baz

Instead. Looking at the implementation this is due to the fact that busybox does not check for newline in patterns when the -e option is given.
Comment 1 Denys Vlasenko 2020-04-30 14:20:50 UTC
Fixed in git