From unknown Thu Sep 11 08:44:10 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#18377 <18377@debbugs.gnu.org> To: bug#18377 <18377@debbugs.gnu.org> Subject: Status: piping output through egrep -- escaping of "+" only needed sometimes. Why? Reply-To: bug#18377 <18377@debbugs.gnu.org> Date: Thu, 11 Sep 2025 15:44:10 +0000 retitle 18377 piping output through egrep -- escaping of "+" only needed so= metimes. Why? reassign 18377 grep submitter 18377 terrygalant.lists@fastest.cc severity 18377 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Sun Aug 31 22:16:10 2014 Received: (at submit) by debbugs.gnu.org; 1 Sep 2014 02:16:10 +0000 Received: from localhost ([127.0.0.1]:55323 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XOHA8-0007Re-Ki for submit@debbugs.gnu.org; Sun, 31 Aug 2014 22:16:09 -0400 Received: from eggs.gnu.org ([208.118.235.92]:33053) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XOH2P-0007EZ-0q for submit@debbugs.gnu.org; Sun, 31 Aug 2014 22:08:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XOH2E-0002c9-9q for submit@debbugs.gnu.org; Sun, 31 Aug 2014 22:08:03 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM, T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:55018) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XOH2E-0002c5-7I for submit@debbugs.gnu.org; Sun, 31 Aug 2014 22:07:58 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34754) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XOH29-0004Un-E4 for bug-grep@gnu.org; Sun, 31 Aug 2014 22:07:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XOH24-0002UL-LI for bug-grep@gnu.org; Sun, 31 Aug 2014 22:07:53 -0400 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:32990) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XOH24-0002U5-IJ for bug-grep@gnu.org; Sun, 31 Aug 2014 22:07:48 -0400 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by gateway2.nyi.internal (Postfix) with ESMTP id 7733C2017B for ; Sun, 31 Aug 2014 22:07:48 -0400 (EDT) Received: from web1 ([10.202.2.211]) by compute6.internal (MEProxy); Sun, 31 Aug 2014 22:07:48 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=fastest.cc; h= message-id:from:to:mime-version:content-transfer-encoding :content-type:subject:date; s=mesmtp; bh=ry0sABPNdGHpWAnVfAYJVE0 QUPU=; b=bbcPsLybTUZq5C03EAC+J79YfDdEuXayfe6504l223Pz8HRoamkK86D X53kTiV1R4hJR4TFa6Yx1vwGGIMg9KFAPCTDweUWODM9HUpvrZG5b3xSUauH7YUj Jxcc8i1vjViorc5xmlbzN+7kVB/K2sYJzalz+hQKuogoGmCtU25E= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=message-id:from:to:mime-version :content-transfer-encoding:content-type:subject:date; s=smtpout; bh=ry0sABPNdGHpWAnVfAYJVE0QUPU=; b=loPjKC4+mMl6mfDmGVonig+KB54h v84bEV5RopYcjrkIgTmlq4V4ruaJniebBPUUa1ut21NyoeeBnTXurKfznqeddRWt THFU3P9jWWW9IWmg7BsI7X7mYZVJMGaPDMS+QzOMTVIdr99fqIKtbfoxWgUqscgu Tbg9wiMfd7Sj+qE= Received: by web1.nyi.internal (Postfix, from userid 99) id 56EAEF00925; Sun, 31 Aug 2014 22:07:48 -0400 (EDT) Message-Id: <1409537268.2857006.158869721.39748DA9@webmail.messagingengine.com> X-Sasl-Enc: 2EdgVz7LiPOApVyRFFP5rih3N+WQlJiJgZlhsqYuoxYF 1409537268 From: terrygalant.lists@fastest.cc To: bug-grep@gnu.org MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain X-Mailer: MessagingEngine.com Webmail Interface - ajax-73bced9a Subject: piping output through egrep -- escaping of "+" only needed sometimes. Why? Date: Sun, 31 Aug 2014 19:07:48 -0700 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.3 (----) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Sun, 31 Aug 2014 22:16:06 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.3 (----) Hi all, I'm trying to pipe of output of a command through egrep. If I do this ldconfig -p | egrep "libstdc++" libstdc++.so.6 (libc6,x86-64) => /usr/lib64/libstdc++.so.6 libstdc++.so.6 (libc6) => /usr/lib/libstdc++.so.6 that *IS* the answer I expect. But if I simply add a ".so" to the egrep target, it returns nothing ldconfig -p | egrep "libstdc++.so" (empty) If I *escape* the two "+", it works again. ldconfig -p | egrep "libstdc\+\+.so" libstdc++.so.6 (libc6,x86-64) => /usr/lib64/libstdc++.so.6 libstdc++.so.6 (libc6) => /usr/lib/libstdc++.so.6 Why do I need to escape the "+" in the last case, but not in the first? Terry From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 01 04:06:06 2014 Received: (at 18377-done) by debbugs.gnu.org; 1 Sep 2014 08:06:06 +0000 Received: from localhost ([127.0.0.1]:55370 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XOMco-0007sk-AI for submit@debbugs.gnu.org; Mon, 01 Sep 2014 04:06:06 -0400 Received: from smtp.cs.ucla.edu ([131.179.128.62]:46952) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XOMcl-0007sB-KP for 18377-done@debbugs.gnu.org; Mon, 01 Sep 2014 04:06:04 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id 092B4A6001E; Mon, 1 Sep 2014 01:05:57 -0700 (PDT) X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu Received: from smtp.cs.ucla.edu ([127.0.0.1]) by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id wa0QkZozLbGZ; Mon, 1 Sep 2014 01:05:51 -0700 (PDT) Received: from [192.168.1.9] (pool-71-177-17-123.lsanca.dsl-w.verizon.net [71.177.17.123]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id E0C99A6001D; Mon, 1 Sep 2014 01:05:51 -0700 (PDT) Message-ID: <540428DF.8070502@cs.ucla.edu> Date: Mon, 01 Sep 2014 01:05:51 -0700 From: Paul Eggert Organization: UCLA Computer Science Department User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.0 MIME-Version: 1.0 To: terrygalant.lists@fastest.cc, 18377-done@debbugs.gnu.org Subject: Re: bug#18377: piping output through egrep -- escaping of "+" only needed sometimes. Why? References: <1409537268.2857006.158869721.39748DA9@webmail.messagingengine.com> In-Reply-To: <1409537268.2857006.158869721.39748DA9@webmail.messagingengine.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: 18377-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.0 (----) terrygalant.lists@fastest.cc wrote: > Why do I need to escape the "+" in the last case, but not in the first? Because "+" is a special character to egrep. The pattern "libstdc++" is equivalent to the pattern "libstdcc*" which matches in the first case, whereas the pattern "libstdc++.so" is equivalent to the pattern "libstdcc*.so" which does not match in the last case. From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 01 07:44:48 2014 Received: (at 18377-done) by debbugs.gnu.org; 1 Sep 2014 11:44:48 +0000 Received: from localhost ([127.0.0.1]:55455 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XOQ2R-0006Gy-CB for submit@debbugs.gnu.org; Mon, 01 Sep 2014 07:44:47 -0400 Received: from mailgw05.kcn.ne.jp ([61.86.7.212]:62297) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XOQ2N-0006Ge-Fw for 18377-done@debbugs.gnu.org; Mon, 01 Sep 2014 07:44:45 -0400 Received: from imp02 (mailgw6.kcn.ne.jp [61.86.15.232]) by mailgw05.kcn.ne.jp (Postfix) with ESMTP id 0F7EF67DF5 for <18377-done@debbugs.gnu.org>; Mon, 1 Sep 2014 20:44:36 +0900 (JST) Received: from mail04.kcn.ne.jp ([61.86.6.183]) by imp02 with bizsmtp id lnkc1o0053wvxAM01nkcHF; Mon, 01 Sep 2014 20:44:36 +0900 X-OrgRCPT: 18377-done@debbugs.gnu.org Received: from [10.120.1.51] (i118-21-128-66.s30.a048.ap.plala.or.jp [118.21.128.66]) by mail04.kcn.ne.jp (Postfix) with ESMTPA id AF29312900C1; Mon, 1 Sep 2014 20:44:35 +0900 (JST) Date: Mon, 01 Sep 2014 20:44:35 +0900 From: Norihiro Tanaka To: terrygalant.lists@fastest.cc Subject: Re: bug#18377: piping output through egrep -- escaping of "+" only needed sometimes. Why? In-Reply-To: <1409537268.2857006.158869721.39748DA9@webmail.messagingengine.com> References: <1409537268.2857006.158869721.39748DA9@webmail.messagingengine.com> Message-Id: <20140901204434.6C61.27F6AC2D@kcn.ne.jp> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Mailer: Becky! ver. 2.65.07 [ja] X-Spam-Score: -1.7 (-) X-Debbugs-Envelope-To: 18377-done Cc: 18377-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) "egrep 'libstdc++'" is taken as "egrep 'libstd(c+)+'", although I don't see that this behaviour is clearly defined in POSIX. Therefore, as Paul says, it's synonymous with 'libstdc(c*)'. On Sun, 31 Aug 2014 19:07:48 -0700 terrygalant.lists@fastest.cc wrote: > Hi all, > > I'm trying to pipe of output of a command through egrep. > > If I do this > > ldconfig -p | egrep "libstdc++" > libstdc++.so.6 (libc6,x86-64) => /usr/lib64/libstdc++.so.6 > libstdc++.so.6 (libc6) => /usr/lib/libstdc++.so.6 > > that *IS* the answer I expect. > > But if I simply add a ".so" to the egrep target, it returns nothing > > ldconfig -p | egrep "libstdc++.so" > (empty) > > If I *escape* the two "+", it works again. > > ldconfig -p | egrep "libstdc\+\+.so" > libstdc++.so.6 (libc6,x86-64) => /usr/lib64/libstdc++.so.6 > libstdc++.so.6 (libc6) => /usr/lib/libstdc++.so.6 > > Why do I need to escape the "+" in the last case, but not in the first? > > Terry > > From unknown Thu Sep 11 08:44:10 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Tue, 30 Sep 2014 11:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator