GNU bug report logs - #27916
sed is limited to 24 patterns when using the delete command

Previous Next

Package: sed;

Reported by: jean-christophe manciot <actionmystique <at> gmail.com>

Date: Wed, 2 Aug 2017 13:37:02 UTC

Severity: normal

Done: Jim Meyering <jim <at> meyering.net>

Bug is archived. No further changes may be made.

Full log


Message #8 received at 27916 <at> debbugs.gnu.org (full text, mbox):

From: Assaf Gordon <assafgordon <at> gmail.com>
To: jean-christophe manciot <actionmystique <at> gmail.com>, 27916 <at> debbugs.gnu.org
Subject: Re: bug#27916: sed is limited to 24 patterns when using the delete
 command
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 <at> 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





This bug report was last modified 7 years and 294 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.