GNU bug report logs - #26726
Support grepping multi-lines fixed-strings

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: grep; Severity: wishlist; Reported by: "ziyunfei" <446240525@HIDDEN>; dated Mon, 1 May 2017 06:54:01 UTC; Maintainer for grep is bug-grep@HIDDEN.
Severity set to 'wishlist' from 'normal' Request was from Paul Eggert <eggert@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 26726 <at> debbugs.gnu.org:


Received: (at 26726) by debbugs.gnu.org; 1 May 2017 12:48:48 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon May 01 08:48:48 2017
Received: from localhost ([127.0.0.1]:48618 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1d5Aky-0003RI-2n
	for submit <at> debbugs.gnu.org; Mon, 01 May 2017 08:48:48 -0400
Received: from mail-ua0-f176.google.com ([209.85.217.176]:34781)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <meyering@HIDDEN>) id 1d5Akw-0003R6-GE
 for 26726 <at> debbugs.gnu.org; Mon, 01 May 2017 08:48:46 -0400
Received: by mail-ua0-f176.google.com with SMTP id g49so5395833uaa.1
 for <26726 <at> debbugs.gnu.org>; Mon, 01 May 2017 05:48:46 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=mime-version:sender:in-reply-to:references:from:date:message-id
 :subject:to:cc;
 bh=cCHdwi4IIAlWYYY+trPg11YKmfFHK3m/VcsABuiSuk4=;
 b=ZY/hglT1/hLtXFcX0HC5Fk01rlWeTijHmVBiBMUwl9YYGMxHuRq1OLhz9dlgNyLSOy
 TNROG0c8pi2mQwVAak8feDMDPpNNevIFANCPmVAszZyTIM9HbFnsymep1jozstlW5YOb
 ulIwZmCsqzBUH4H2PJObSlcjvf7irzT6aWFKysh+ro7AxGbJ82dBbru6FhH7cFqjL6+t
 LuHNJdxAEuvRd9YX5EWo+5dBfE27DQdL8cTLNn2+2/eXwMWKnglcMgcjdB2XgTglJeuc
 UeZWaxYULYsKdWRa50ajJCwKkFtO060UQN6QGy98Iv9x7m2FqJW2D4CC+J3Ou4ivXpcR
 2pEA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:sender:in-reply-to:references:from
 :date:message-id:subject:to:cc;
 bh=cCHdwi4IIAlWYYY+trPg11YKmfFHK3m/VcsABuiSuk4=;
 b=QtRnpHHEN26+Weuu+PINFffyzzLlpBPQcern0TDqXMJrRJssqX3GV7Mud5fY9qcqKL
 OTPS5LrmwfWwd8Jq3GdDDrMIPXOE3jf5rVhiyQerJLkFul7C600ivL+WmIUNs52gALvw
 vVBmzHHLQwBAOqcmTuwOEIW+A9lIJVpLyKtXTdPJiZ5X+0CXVRxe3Vauk3n65J6u9hos
 0O+spfnKqbmMqblOigJpNqUW5brIYrDOOuNwVIX/q9jSKdsztQaCdUuiQ6plBp3pjdS+
 iTVwMYS4itY8vAVDt4OLRv6ANfk53aQkn1aRjvUPPx6pPbkozGlTeVYQglB/dcaa/rVX
 a2Uw==
X-Gm-Message-State: AN3rC/5RAjjiT2rubjtwJRwwmxBqEHapVGFsEKdSaoS0KKJ5sX4h4hZu
 4+3iDv9sHVTQSlN816jL1rMBIC48qg==
X-Received: by 10.176.25.15 with SMTP id v15mr7761787uag.81.1493642920819;
 Mon, 01 May 2017 05:48:40 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.176.82.75 with HTTP; Mon, 1 May 2017 05:48:20 -0700 (PDT)
In-Reply-To: <tencent_104467C1659C99351880762E@HIDDEN>
References: <tencent_104467C1659C99351880762E@HIDDEN>
From: Jim Meyering <jim@HIDDEN>
Date: Mon, 1 May 2017 21:48:20 +0900
X-Google-Sender-Auth: iKheKZGXO7iXl5jfq5q0i-s65qQ
Message-ID: <CA+8g5KGZk6_6XVw5LvcvMW_DX78oN=OCDbYS5teui2z4WbQ5HQ@HIDDEN>
Subject: Re: bug#26726: Support grepping multi-lines fixed-strings
To: ziyunfei <446240525@HIDDEN>
Content-Type: text/plain; charset=UTF-8
X-Spam-Score: -2.6 (--)
X-Debbugs-Envelope-To: 26726
Cc: 26726 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.6 (--)

On Mon, May 1, 2017 at 3:38 PM, ziyunfei <446240525@HIDDEN> wrote:
> I have the same need as http://stackoverflow.com/questions/14631794/check-if-file-contains-some-text-not-regex-in-unix#comment20438757_14631832.
>
> $ cat file
> foo
> bar
>
> $ echo "$fixed_string"
> bar
> foo
>
> $ grep -Fzq "$fixed_string" file && echo "Matched" || echo "Not matched"
> Matched # false positive, -z doesn't apply to -F
>
>
> $ [[ "$(cat file)" = *"$fixed_string"* ]] && echo "Matched" || echo "not matched"
> not matched # my workaround

Consider using perl, i.e., this matches:

   $ pat='foo
  bar'
  $ printf '%s\n' foo bar | perl -0 -ne 'm!\Q'"$pat"'\E! or die'

This does not match:

  $ printf '%s\n' bar foo | perl -0 -ne 'm!\Q'"$pat"'\E! or die'
  Died at -e line 1, <> chunk 1.




Information forwarded to bug-grep@HIDDEN:
bug#26726; Package grep. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 1 May 2017 06:53:13 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon May 01 02:53:13 2017
Received: from localhost ([127.0.0.1]:48438 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1d55Cr-0001kf-13
	for submit <at> debbugs.gnu.org; Mon, 01 May 2017 02:53:13 -0400
Received: from eggs.gnu.org ([208.118.235.92]:59503)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <446240525@HIDDEN>) id 1d54zF-0001Qx-9j
 for submit <at> debbugs.gnu.org; Mon, 01 May 2017 02:39:12 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <446240525@HIDDEN>) id 1d54z9-00037g-8b
 for submit <at> debbugs.gnu.org; Mon, 01 May 2017 02:39:04 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: **
X-Spam-Status: No, score=2.0 required=5.0 tests=BAYES_50,
 FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,FROM_EXCESS_BASE64,HTML_MESSAGE,
 T_DKIM_INVALID autolearn=disabled version=3.3.2
Received: from lists.gnu.org ([2001:4830:134:3::11]:52378)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <446240525@HIDDEN>) id 1d54z9-00037c-5a
 for submit <at> debbugs.gnu.org; Mon, 01 May 2017 02:39:03 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:50473)
 by lists.gnu.org with esmtp (Exim 4.71)
 (envelope-from <446240525@HIDDEN>) id 1d54z8-0001eE-1C
 for bug-grep@HIDDEN; Mon, 01 May 2017 02:39:02 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <446240525@HIDDEN>) id 1d54z3-00037L-4j
 for bug-grep@HIDDEN; Mon, 01 May 2017 02:39:02 -0400
Received: from smtpbg65.qq.com ([103.7.28.233]:41889)
 by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <446240525@HIDDEN>) id 1d54z2-00037B-AX
 for bug-grep@HIDDEN; Mon, 01 May 2017 02:38:57 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qq.com; s=s201512;
 t=1493620728; bh=SG6QdORTaMU+YLFZU6sQmvrdzsgcUjHNod7auq83ruA=;
 h=From:To:Subject:Mime-Version:Content-Type:Content-Transfer-Encoding:Date:Message-ID;
 b=PCyqrcpqgZxCiDoecvn3RsCu6z3ey/m9ygpCofx2ZCHllt1tG86/bGpl9IIa7mTEG
 bdZi5Omz16QHKQtUK/aaEakU6A5KektCfPPvZz+i9OlCapw/kbpATqE6+eRYq3mVjb
 GE3Cx+EyNf+kjLlLxqjtENmWmpui0/Jh3bxA7UK8=
X-QQ-FEAT: 5nAP71ObQpVkxOyhHZuQboKCawLVmGrtdfgVgqafT6vEgK2uQIo7dwHZ4Lfwl
 Fk199+dI5TSKxf7/6du5rDn2XmADV0ThnUendi+ziH0kiuR622imwZ99+sDyysIftU+r8kE
 SQASXiHreUGj85xPzcW6MvGfA5MpVaWihxqX08u/DgHaN3iqJ/x2bIYbeW0PWR1pYoZN+Ns
 zYDmVUYhG8j8vQtqBK39X5OjmaUk56O+dh3EucpsU5tQlPAcmXwaqqGspC/F83HkV1ceeVL
 xmsA==
X-QQ-SSF: 000000000000004000000000000000E
X-HAS-ATTACH: no
X-QQ-BUSINESS-ORIGIN: 2
X-Originating-IP: 183.157.167.43
X-QQ-STYLE: 
X-QQ-mid: webmail323t1493620726t5036747
From: "=?ISO-8859-1?B?eml5dW5mZWk=?=" <446240525@HIDDEN>
To: "=?ISO-8859-1?B?YnVnLWdyZXA=?=" <bug-grep@HIDDEN>
Subject: Support grepping multi-lines fixed-strings
Mime-Version: 1.0
Content-Type: multipart/alternative;
 boundary="----=_NextPart_5906D7F6_0BFBA3A8_1749BD6D"
Content-Transfer-Encoding: 8Bit
Date: Mon, 1 May 2017 14:38:46 +0800
X-Priority: 3
Message-ID: <tencent_104467C1659C99351880762E@HIDDEN>
X-QQ-MIME: TCMime 1.0 by Tencent
X-Mailer: QQMail 2.x
X-QQ-Mailer: QQMail 2.x
X-QQ-SENDSIZE: 520
Feedback-ID: webmail:qq.com:bgforeign:bgforeign1
X-QQ-Bgrelay: 1
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x [fuzzy]
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 2001:4830:134:3::11
X-Spam-Score: -3.7 (---)
X-Debbugs-Envelope-To: submit
X-Mailman-Approved-At: Mon, 01 May 2017 02:53:11 -0400
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.7 (---)

This is a multi-part message in MIME format.

------=_NextPart_5906D7F6_0BFBA3A8_1749BD6D
Content-Type: text/plain;
	charset="ISO-8859-1"
Content-Transfer-Encoding: base64

SSBoYXZlIHRoZSBzYW1lIG5lZWQgYXMgaHR0cDovL3N0YWNrb3ZlcmZsb3cuY29tL3F1ZXN0
aW9ucy8xNDYzMTc5NC9jaGVjay1pZi1maWxlLWNvbnRhaW5zLXNvbWUtdGV4dC1ub3QtcmVn
ZXgtaW4tdW5peCNjb21tZW50MjA0Mzg3NTdfMTQ2MzE4MzIuDQoNCg0KJCBjYXQgZmlsZQ0K
Zm9vDQpiYXINCg0KJCBlY2hvICIkZml4ZWRfc3RyaW5nIg0KYmFyDQpmb28NCg0KJCBncmVw
IC1GenEgIiRmaXhlZF9zdHJpbmciIGZpbGUgJiYgZWNobyAiTWF0Y2hlZCIgfHwgZWNobyAi
Tm90IG1hdGNoZWQiDQpNYXRjaGVkICMgZmFsc2UgcG9zaXRpdmUsIC16IGRvZXNuJ3QgYXBw
bHkgdG8gLUYNCg0KDQokIFtbICIkKGNhdCBmaWxlKSIgPSAqIiRmaXhlZF9zdHJpbmciKiBd
XSAmJiBlY2hvICJNYXRjaGVkIiB8fCBlY2hvICJub3QgbWF0Y2hlZCINCm5vdCBtYXRjaGVk
ICMgbXkgd29ya2Fyb3VuZA==

------=_NextPart_5906D7F6_0BFBA3A8_1749BD6D
Content-Type: text/html;
	charset="ISO-8859-1"
Content-Transfer-Encoding: base64

PGRpdj5JIGhhdmUgdGhlIHNhbWUgbmVlZCBhcyBodHRwOi8vc3RhY2tvdmVyZmxvdy5jb20v
cXVlc3Rpb25zLzE0NjMxNzk0L2NoZWNrLWlmLWZpbGUtY29udGFpbnMtc29tZS10ZXh0LW5v
dC1yZWdleC1pbi11bml4I2NvbW1lbnQyMDQzODc1N18xNDYzMTgzMi48L2Rpdj48ZGl2Pjxi
cj48L2Rpdj48ZGl2PiQmbmJzcDtjYXQgZmlsZTwvZGl2PjxkaXY+PGRpdj5mb288L2Rpdj48
ZGl2PmJhcjwvZGl2PjwvZGl2PjxkaXY+JCZuYnNwO2VjaG8gIiRmaXhlZF9zdHJpbmciPC9k
aXY+PGRpdj48ZGl2PmJhcjwvZGl2PjxkaXY+Zm9vPC9kaXY+PC9kaXY+PGRpdj4kIGdyZXAg
LUZ6cSAiJGZpeGVkX3N0cmluZyIgZmlsZSAmYW1wOyZhbXA7IGVjaG8gIk1hdGNoZWQiIHx8
IGVjaG8gIk5vdCBtYXRjaGVkIjwvZGl2PjxkaXY+TWF0Y2hlZCAjIGZhbHNlIHBvc2l0aXZl
LCAteiBkb2Vzbid0Jm5ic3A7YXBwbHkgdG8gLUY8L2Rpdj48ZGl2Pjxicj48L2Rpdj48ZGl2
PiQgW1sgIiQoY2F0IGZpbGUpIiA9ICoiJGZpeGVkX3N0cmluZyIqIF1dICZhbXA7JmFtcDsg
ZWNobyAiTWF0Y2hlZCIgfHwgZWNobyAibm90IG1hdGNoZWQiPC9kaXY+PGRpdj5ub3QgbWF0
Y2hlZCAjIG15IHdvcmthcm91bmQ8L2Rpdj48ZGl2Pjxicj48L2Rpdj48ZGl2Pjxicj48L2Rp
dj4=

------=_NextPart_5906D7F6_0BFBA3A8_1749BD6D--







Acknowledgement sent to "ziyunfei" <446240525@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-grep@HIDDEN. Full text available.
Report forwarded to bug-grep@HIDDEN:
bug#26726; Package grep. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Mon, 25 Nov 2019 12:00:02 UTC

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