From unknown Tue Jun 24 03:23:08 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#17032 <17032@debbugs.gnu.org> To: bug#17032 <17032@debbugs.gnu.org> Subject: Status: side effect bug... Reply-To: bug#17032 <17032@debbugs.gnu.org> Date: Tue, 24 Jun 2025 10:23:08 +0000 retitle 17032 side effect bug... reassign 17032 grep submitter 17032 Rom=C3=A9o Capulet severity 17032 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 18 00:59:33 2014 Received: (at submit) by debbugs.gnu.org; 18 Mar 2014 04:59:33 +0000 Received: from localhost ([127.0.0.1]:39428 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WPm7g-0000iX-IZ for submit@debbugs.gnu.org; Tue, 18 Mar 2014 00:59:33 -0400 Received: from eggs.gnu.org ([208.118.235.92]:44061) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WPlqp-0000FL-Uh for submit@debbugs.gnu.org; Tue, 18 Mar 2014 00:42:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WPlqg-0004fn-3t for submit@debbugs.gnu.org; Tue, 18 Mar 2014 00:42:07 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:37284) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WPlqg-0004fj-11 for submit@debbugs.gnu.org; Tue, 18 Mar 2014 00:41:58 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45742) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WPlqY-0004Ps-Ed for bug-grep@gnu.org; Tue, 18 Mar 2014 00:41:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WPlqQ-0004eb-9c for bug-grep@gnu.org; Tue, 18 Mar 2014 00:41:50 -0400 Received: from mout.gmx.net ([212.227.17.21]:63052) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WPlqP-0004eO-Vq for bug-grep@gnu.org; Tue, 18 Mar 2014 00:41:42 -0400 Received: from [192.168.0.2] ([85.168.89.128]) by mail.gmx.com (mrgmx102) with ESMTPSA (Nemesis) id 0LzYY2-1XBScr0cp0-014neO for ; Tue, 18 Mar 2014 05:41:39 +0100 Message-ID: <5327CE6B.5070508@gmx.fr> Date: Tue, 18 Mar 2014 05:41:15 +0100 From: =?ISO-8859-1?Q?Rom=E9o_Capulet?= User-Agent: Mozilla/5.0 (X11; Linux i686; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 MIME-Version: 1.0 To: bug-grep@gnu.org Subject: side effect bug... Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:sFC+ILn6Rxjr+rlw2jCA0JkhI97WUUzm0UZmfVVr0ktJL9YWkf9 /8Lxt5vlm1fVx68vIjpQxRV9+Azn+XLPHmCYEsAJVemL1iDfx1bYr9PKJiatm7Nf2xrjH66 rDR56pdyQrjC84d1CP2eMWR5ghPyX3mxxcgs0tWTwFh3Tbokious80eKIDT30Ph2XdrMeAI psp5u7nUMmK/06pMfQRXw== X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] 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.1 (----) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Tue, 18 Mar 2014 00:59:30 -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.1 (----) The option "-n" have a side effect with the option "-P" and the regexp '^\r$', the line numbers got overwritten by the carriage return char so these don't appear on output. cmd ex: grep -Pn '^\r$' file.txt ps: I know I can see the numbers by redirecting output in a file. From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 18 12:00:10 2014 Received: (at 17032-done) by debbugs.gnu.org; 18 Mar 2014 16:00:10 +0000 Received: from localhost ([127.0.0.1]:40313 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WPwQz-00044a-6S for submit@debbugs.gnu.org; Tue, 18 Mar 2014 12:00:09 -0400 Received: from mail-pa0-f43.google.com ([209.85.220.43]:43886) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WPwQv-000442-5l for 17032-done@debbugs.gnu.org; Tue, 18 Mar 2014 12:00:06 -0400 Received: by mail-pa0-f43.google.com with SMTP id bj1so7513367pad.30 for <17032-done@debbugs.gnu.org>; Tue, 18 Mar 2014 09:00:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type:content-transfer-encoding; bh=pDaJZX8fKz/KAM/jbkwD9/dPO5nfMx3qxFge3+dnikA=; b=wDdj9jHaiJEgUXJ1SDMcNv6HczDykv/pG35YNi7UUgu0tKYNrLd0+s7RnJR9mAHfqw u9unRGPJguuJ1zG6rsc4b4aII2tai+m6+uPWpDrYnT8xMwJtqEnHu0DjH0jOX676jIO6 gGjLCaSK2rKW3loKP0A4uzYVczHWFqcKV/LUCmZec54iPtR4hiQznI8v46TR7KSK+NS/ d9TNbgIHMUnBms2j4+qV161ADfaH7JPWmVHX1EUsqywRh/ZToIQSAbCQpS9lnC7F+VQS +Rh0vCNPdKAChzIzBLUGoqy+/S4fN+UVdzOiFj/QMn3G0qCa6a3I61JYIKmo8pDgE6Ea TCGg== X-Received: by 10.66.121.195 with SMTP id lm3mr11563651pab.154.1395158404103; Tue, 18 Mar 2014 09:00:04 -0700 (PDT) MIME-Version: 1.0 Received: by 10.68.201.231 with HTTP; Tue, 18 Mar 2014 08:59:39 -0700 (PDT) In-Reply-To: <5327CE6B.5070508@gmx.fr> References: <5327CE6B.5070508@gmx.fr> From: Jim Meyering Date: Tue, 18 Mar 2014 08:59:39 -0700 X-Google-Sender-Auth: qT-jDBNKsEiHUh2Z0S_1kzc6oN0 Message-ID: Subject: Re: bug#17032: side effect bug... To: =?ISO-8859-1?Q?Rom=E9o_Capulet?= Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 17032-done Cc: 17032-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: -0.7 (/) tags 17032 + notabug thanks On Mon, Mar 17, 2014 at 9:41 PM, Rom=E9o Capulet wrote= : > The option "-n" have a side effect with the option "-P" and the regexp > '^\r$', the line numbers got overwritten by the carriage return char so > these don't appear on output. > > cmd ex: grep -Pn '^\r$' file.txt > > ps: I know I can see the numbers by redirecting output in a file. Thanks for the report. You can avoid that in at least two ways: either filter out all \r bytes or filter through something like cat -A that renders them another way: grep -Pn '^\r$' file.txt | tr -d '\r' or grep -Pn '^\r$' file.txt | cat -A From unknown Tue Jun 24 03:23:08 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Wed, 16 Apr 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