Subject: bug#27916: sed is limited to 24 patterns when using the delete command

From: Assaf Gordon <[email-masked]>
Date: Wed, 2 Aug 2017 23:58:02 -0600

Hello,

from a cursory look:

On 08/02/2017 07:35 AM, jean-christophe manciot wrote:
> *With 25 patterns, sed fails to filter 'build-aux*':
> root@samsung-ubuntu:/home/actionmystique/src# find -L -path
> './*/build-*.sh' 2>/dev/null | sed -E '/.*ExpressVPN/client\..*$/d;
> /\.gd.*$/d; /.*git-Tao_Te_eChing.*$/d; /.*\.gnupg.*$/d;
[...]

Could it be that this 25th pattern that you've added (as the first
sed command) has an un-escaped slash, which messes up the rest of the
patterns ?

That is, the sed command "/.*ExpressVPN/client\..*$/d;'
actually means: match lines with "ExpressVPN",
then "c" (change) the lines to "lient\n..*$d/;".

Example:

  $ echo "ExpressVPN" | sed -E '/.*ExpressVPN/client\..*$/d;'
  lient..*$/d;

And, if this is the first pattern, then all the rest of the text
is treated as the same line to change, and not as additional sed
patterns:

  $ echo "ExpressVPN" | sed -E '/.*ExpressVPN/client\..*$/d;
  /Anything Else/d'

  lient..*$/d; /Anything Else/d

This is a just a quick guess, I haven't been able to reproduce
what you're seeing otherwise.

regards,
 - assaf