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.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 27916 in the body.
You can then email your comments to 27916 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-sed <at> gnu.org:
bug#27916; Package sed. (Wed, 02 Aug 2017 13:37:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to jean-christophe manciot <actionmystique <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-sed <at> gnu.org. (Wed, 02 Aug 2017 13:37:02 GMT) Full text and rfc822 format available.

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

From: jean-christophe manciot <actionmystique <at> gmail.com>
To: bug-sed <at> gnu.org
Subject: sed is limited to 24 patterns when using the delete command
Date: Wed, 2 Aug 2017 15:35:53 +0200
[Message part 1 (text/plain, inline)]
sed (GNU sed) 4.4

*With 24 patterns, sed filters correctly 'build-aux':*
root <at> samsung-ubuntu:/home/actionmystique/src# find -L -path
'./*/build-*.sh' 2>/dev/null | sed -E '/\.gd.*$/d;
/.*git-Tao_Te_eChing.*$/d; /.*\.gnupg.*$/d; /.*google-chrome.*$/d;
/.*\.gpg$/d; /.*_key.*$/d; /.*\/\.key.*$/d; /.*\/key.*$/d; /.*\.key$/d;
/.*_Key.*$/d; /.*\..*\.luks$/d; /.*OAuth2.*$/d; /.*\/\.passwd.*$/d;
/.*\/passwd.*$/d; /.*\/\.password.*$/d; /.*\/password.*$/d; /.*\.pem$/d;
/.*\.ssh.*$/d; /.*\/tmp.*$/d; /.*\/Trash.*$/d; /.*Webmin.*$/d; /.*xca.*$/d;
/.*build-area.*$/d; /.*build-aux.*$/d' | grep -- "build-aux"
root <at> samsung-ubuntu:/home/actionmystique/src#

*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;
/.*google-chrome.*$/d; /.*\.gpg$/d; /.*_key.*$/d; /.*\/\.key.*$/d;
/.*\/key.*$/d; /.*\.key$/d; /.*_Key.*$/d; /.*\..*\.luks$/d; /.*OAuth2.*$/d;
/.*\/\.passwd.*$/d; /.*\/passwd.*$/d; /.*\/\.password.*$/d;
/.*\/password.*$/d; /.*\.pem$/d; /.*\.ssh.*$/d; /.*\/tmp.*$/d;
/.*\/Trash.*$/d; /.*Webmin.*$/d; /.*xca.*$/d; /.*build-area.*$/d;
/.*build-aux.*$/d' | grep -- "build-aux"
./GTK-VNC/git-gtk-vnc/build-aux/ltmain.sh
./Xtables/xtables-addons/debian/xtables-addons-dkms/usr/src/xtables-addons-2.12/build-aux/ltmain.sh
./Xtables/xtables-addons/build-aux/ltmain.sh
...

*With the same 25 patterns grep filters correctly 'build-aux':*
root <at> samsung-ubuntu:/home/actionmystique/src# find -L -path
'./*/build-*.sh' 2>/dev/null | grep -vP --
'.*ExpressVPN/client\..*$|\.gd.*$|.*git-Tao_Te_eChing.*$|.*\.gnupg.*$|.*google-chrome.*$|.*\.gpg$|.*_key.*$|.*\/\.key.*$|.*\/key.*$|.*\.key$|.*_Key.*$|.*\..*\.luks$|.*OAuth2.*$|.*\/\.passwd.*$|.*\/passwd.*$|.*\/\.password.*$|.*\/password.*$|.*\.pem$|.*\.ssh.*$|.*\/tmp.*$|.*\/Trash.*$|.*Webmin.*$|.*xca.*$|.*build-area.*$|.*build-aux.*$'
| grep -- "build-aux"
root <at> samsung-ubuntu:/home/actionmystique/src#

It's strange that 24 is the limit.
-- 
Jean-Christophe Manciot
[Message part 2 (text/html, inline)]

Information forwarded to bug-sed <at> gnu.org:
bug#27916; Package sed. (Thu, 03 Aug 2017 05:59:01 GMT) Full text and rfc822 format available.

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





Information forwarded to bug-sed <at> gnu.org:
bug#27916; Package sed. (Thu, 03 Aug 2017 09:02:02 GMT) Full text and rfc822 format available.

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

From: jean-christophe manciot <actionmystique <at> gmail.com>
To: Assaf Gordon <assafgordon <at> gmail.com>
Cc: 27916 <at> debbugs.gnu.org
Subject: Re: bug#27916: sed is limited to 24 patterns when using the delete
 command
Date: Thu, 3 Aug 2017 11:00:59 +0200
[Message part 1 (text/plain, inline)]
You're right, my bad.

On Thu, Aug 3, 2017 at 7:58 AM, Assaf Gordon <assafgordon <at> gmail.com> wrote:

> 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
>
>


-- 
Jean-Christophe
[Message part 2 (text/html, inline)]

Reply sent to Jim Meyering <jim <at> meyering.net>:
You have taken responsibility. (Thu, 03 Aug 2017 22:07:02 GMT) Full text and rfc822 format available.

Notification sent to jean-christophe manciot <actionmystique <at> gmail.com>:
bug acknowledged by developer. (Thu, 03 Aug 2017 22:07:02 GMT) Full text and rfc822 format available.

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

From: Jim Meyering <jim <at> meyering.net>
To: jean-christophe manciot <actionmystique <at> gmail.com>
Cc: Assaf Gordon <assafgordon <at> gmail.com>, 27916-done <at> debbugs.gnu.org
Subject: Re: bug#27916: sed is limited to 24 patterns when using the delete
 command
Date: Thu, 3 Aug 2017 15:06:21 -0700
tags 27916 + notabug
thanks

On Thu, Aug 3, 2017 at 2:00 AM, jean-christophe manciot
<actionmystique <at> gmail.com> wrote:
> You're right, my bad.

Marking as resolved/notabug in our tracker.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 01 Sep 2017 11:24:03 GMT) Full text and rfc822 format available.

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.