From unknown Sun Aug 17 22:07:50 2025 X-Loop: help-debbugs@gnu.org Subject: bug#25651: Weird output of random files Resent-From: "rexkogitans@gmx.at" Original-Sender: "Debbugs-submit" Resent-CC: bug-grep@gnu.org Resent-Date: Tue, 07 Feb 2017 20:32:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 25651 X-GNU-PR-Package: grep X-GNU-PR-Keywords: To: 25651@debbugs.gnu.org X-Debbugs-Original-To: bug-grep@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.14864994709223 (code B ref -1); Tue, 07 Feb 2017 20:32:01 +0000 Received: (at submit) by debbugs.gnu.org; 7 Feb 2017 20:31:10 +0000 Received: from localhost ([127.0.0.1]:59325 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cbCPt-0002Oh-Vu for submit@debbugs.gnu.org; Tue, 07 Feb 2017 15:31:10 -0500 Received: from eggs.gnu.org ([208.118.235.92]:37892) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cbCJo-0002EB-KI for submit@debbugs.gnu.org; Tue, 07 Feb 2017 15:24:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cbCJi-0006kp-9x for submit@debbugs.gnu.org; Tue, 07 Feb 2017 15:24:47 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: * X-Spam-Status: No, score=1.3 required=5.0 tests=BAYES_50,FREEMAIL_FROM, HTML_MESSAGE,RCVD_IN_SORBS_SPAM autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:33307) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cbCJi-0006ki-76 for submit@debbugs.gnu.org; Tue, 07 Feb 2017 15:24:46 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57080) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cbCJg-0003fM-SS for bug-grep@gnu.org; Tue, 07 Feb 2017 15:24:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cbCJc-0006bq-2Z for bug-grep@gnu.org; Tue, 07 Feb 2017 15:24:44 -0500 Received: from mout.gmx.net ([212.227.17.22]:56925) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cbCJb-0006ZN-Mj for bug-grep@gnu.org; Tue, 07 Feb 2017 15:24:40 -0500 Received: from [141.201.229.148] ([141.201.229.148]) by mail.gmx.com (mrgmx103 [212.227.17.168]) with ESMTPSA (Nemesis) id 0LpsmR-1byZqY3RDT-00fgKQ for ; Tue, 07 Feb 2017 21:24:34 +0100 From: "rexkogitans@gmx.at" Message-ID: <5feb1e32-16f9-f9a4-b8ee-329958682622@gmx.at> Date: Tue, 7 Feb 2017 21:24:32 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="------------F515E85000731D8AE6D81DED" X-Provags-ID: V03:K0:IiPbn2ZLDHZdntT2x/4TGq/zWhwVSgSogkhgmS8NFWtkesAmJX4 mBX1z3Au3e/5eLfujVRbujZTWAEiMl35ROS3Cn8qkNny+PKZ4EdhQrY4XgikLgxVfayoX9+ GEs6jHxMQYDGjuxxuxZPEDvRQ9Eerxs44TSQKCmtGsrlKFvYSkoA5lc2E42o4rWAeFmwsR9 ZRLhFdf8r5t76y1nzp3HA== X-UI-Out-Filterresults: notjunk:1;V01:K0:9/Ut4HlpZjU=:p31zrX/7Et9gl8S0Mowek1 eZWx8IFb8M5FgB4ktxgNxV5Ku3ryd81YoOYx03rqbLak8IebGiFMDRTr5OeMxDZ6z8lEpHbT0 nEiJJHCY+8053cJ5FswJkbWaffXBvZSGZ2xd1v6cY7AqhwBulm1yx2pPIPjN1Aks4jR32vwP8 +Vrs0dWfUCydBdZbl5aNH9PFiwkjdGB4kmCoZidA/tKpup+WiuHEixhenfnDh70YA2wVcd9j3 5ds854vNqiR1MHIOsRoZJWm7RJd4aO7huA/gC+CNrz+Zd/bf+s5oGa8Di/9rhS7wVdNi64uTO 7GgBlQhQxz/+S2k040Jozgyk5RmTe7ozpyOZPsMkOJqtgofjDV6ejoUpdBB7jPEScIlVwVxPI tsGaM4THvmicxKozDL+/mHw7+am4wFtS3KsRgZFGNeD7excoasds3t64d/az8ECSFl7THYXjQ 82waJvAjVmHCRgRWfOb+is7v3s+w9WVp9d8swAEBsD9z6dKbvVcTbKHcYngw8HLgppX7/lanD ivS7VTeG4gTHvyfTSszxSdYBGBwdEKDSb3popyGiDIAf4Em5lcKepRMfgs/qQVvTrl6MSavFQ bUDdNoSCH5pt47wiJXhZHPEOZA6pCd7yH5Jhsfpuuy99DCxEyxnrQy5ym8iOaCcAwbsY/mwdd KqJEv94TP0E+E1DnwYM7sk80GFaw91rMqCYA0twqSi8jBvcCtwOMJfZDYzk4vciKV2RxmrxvE b6jMKw7MvGAP3pcV+hBeeiTMiEh0zu861BxBnK9c1NRHmaktsJj6R26CZyOINrMKNQ/NmjNFL uDifrZ6w+BdDEPwMhQOhXrzP+T4Oa2tDtxSPu5LcCMqr0jlIdjgSHe4LkOjcbMbfPmCkT7g+w 1jllf2teU0rQzpHAQluWvU9DZRyEo2ZohchmXX3bba+0FIeDNbft+XipIcYAOKWYU4HLT+fb5 q05U9+Iuk+J524vQPhE0KmYbzX1Nqbu2NEA/hph2krdVdubyneuqbnagT6x7+roUKQkXSndOO 1CkjWOVAFaLv5aXHLiX0uY4= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [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.6 (---) X-Mailman-Approved-At: Tue, 07 Feb 2017 15:31:08 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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: -3.6 (---) This is a multi-part message in MIME format. --------------F515E85000731D8AE6D81DED Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Hello, I could repeatedly reproduce an unexpected behaviour on several Linux systems (two installations of Arch Linux [newest state], a Debian [8.7] and a Ubuntu [16.4]). I ran the following command - when I first ran it, it was accidentially ps ax | grep -reh I wanted to grep for processes containing the string "-reh", but forgot the "-e" which was necessary due to the leading dash in the string. On all systems, grep outputs hundreds of (not even matching) lines from files of my home directory, not at all related to the output of ps, which I piped into grep. Maybe, the command line is interpreted as: * r ... search files recursively in directories. Note, that input is read from stdin here. * e ... use the following pattern * h ... this is the pattern expected by "e" It may be that all the lines ouput by grep contain "h". Although expected to be identical, this command works as expected: ps ax | grep -reh /dev/stdin Kind regards, rexkogitans --------------F515E85000731D8AE6D81DED Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 7bit

Hello,

I could repeatedly reproduce an unexpected behaviour on several Linux systems (two installations of Arch Linux [newest state], a Debian [8.7] and a Ubuntu [16.4]).

I ran the following command - when I first ran it, it was accidentially

ps ax | grep -reh

I wanted to grep for processes containing the string "-reh", but forgot the "-e" which was necessary due to the leading dash in the string.

On all systems, grep outputs hundreds of (not even matching) lines from files of my home directory, not at all related to the output of ps, which I piped into grep.

Maybe, the command line is interpreted as:

* r ... search files recursively in directories. Note, that input is read from stdin here.

* e ... use the following pattern

* h ... this is the pattern expected by "e"

It may be that all the lines ouput by grep contain "h".

Although expected to be identical, this command works as expected:

ps ax | grep -reh /dev/stdin
Kind regards,

rexkogitans


--------------F515E85000731D8AE6D81DED-- From unknown Sun Aug 17 22:07:50 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: "rexkogitans@gmx.at" Subject: bug#25651: closed (Re: bug#25651: Weird output of random files) Message-ID: References: <12aa46c3-7684-1b69-dde1-ff45211736b2@cs.ucla.edu> <5feb1e32-16f9-f9a4-b8ee-329958682622@gmx.at> X-Gnu-PR-Message: they-closed 25651 X-Gnu-PR-Package: grep Reply-To: 25651@debbugs.gnu.org Date: Tue, 07 Feb 2017 22:32:03 +0000 Content-Type: multipart/mixed; boundary="----------=_1486506723-19943-1" This is a multi-part message in MIME format... ------------=_1486506723-19943-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #25651: Weird output of random files which was filed against the grep package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 25651@debbugs.gnu.org. --=20 25651: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D25651 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1486506723-19943-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 25651-done) by debbugs.gnu.org; 7 Feb 2017 22:31:05 +0000 Received: from localhost ([127.0.0.1]:59369 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cbEHx-0005AU-2z for submit@debbugs.gnu.org; Tue, 07 Feb 2017 17:31:05 -0500 Received: from zimbra.cs.ucla.edu ([131.179.128.68]:51402) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cbEHv-0005A0-Vn for 25651-done@debbugs.gnu.org; Tue, 07 Feb 2017 17:31:04 -0500 Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 943A5160090; Tue, 7 Feb 2017 14:30:57 -0800 (PST) Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id s6tqCnaioz57; Tue, 7 Feb 2017 14:30:56 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id B364C1600AE; Tue, 7 Feb 2017 14:30:56 -0800 (PST) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id RJ2bVI0DZxJj; Tue, 7 Feb 2017 14:30:56 -0800 (PST) Received: from Penguin.CS.UCLA.EDU (Penguin.CS.UCLA.EDU [131.179.64.200]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 99DF8160090; Tue, 7 Feb 2017 14:30:56 -0800 (PST) Subject: Re: bug#25651: Weird output of random files To: "rexkogitans@gmx.at" , 25651-done@debbugs.gnu.org References: <5feb1e32-16f9-f9a4-b8ee-329958682622@gmx.at> From: Paul Eggert Organization: UCLA Computer Science Department Message-ID: <12aa46c3-7684-1b69-dde1-ff45211736b2@cs.ucla.edu> Date: Tue, 7 Feb 2017 14:30:56 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 MIME-Version: 1.0 In-Reply-To: <5feb1e32-16f9-f9a4-b8ee-329958682622@gmx.at> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 25651-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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.0 (/) On 02/07/2017 12:24 PM, rexkogitans@gmx.at wrote: > Maybe, the command line is interpreted as: > > * r ... search files recursively in directories. Note, that input is > read from stdin here. > > * e ... use the following pattern > > * h ... this is the pattern expected by "e" Yes, that's the interpretation that 'grep' uses, except that it reads input from ".", not from stdin. That is, 'grep -r PAT' is equivalen to 'grep -r PAT .'. This is for convenience: as it does not make sense to use -r on an input stream, the default input is '.' instead of '-' when -r is used. grep cannot "know" that the user wanted it to read from stdin, for the same reason that it does not "know" that the user wanted it to read from stdin here: ps ax | grep 0:00 xyz This causes 'grep' to read from the file 'xyz', instead of the desired behavior of looking for the pattern '0:00 xyz' in the 'ps ax' output. The 'ps ax' output is ignored. ------------=_1486506723-19943-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 7 Feb 2017 20:31:10 +0000 Received: from localhost ([127.0.0.1]:59325 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cbCPt-0002Oh-Vu for submit@debbugs.gnu.org; Tue, 07 Feb 2017 15:31:10 -0500 Received: from eggs.gnu.org ([208.118.235.92]:37892) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cbCJo-0002EB-KI for submit@debbugs.gnu.org; Tue, 07 Feb 2017 15:24:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cbCJi-0006kp-9x for submit@debbugs.gnu.org; Tue, 07 Feb 2017 15:24:47 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: * X-Spam-Status: No, score=1.3 required=5.0 tests=BAYES_50,FREEMAIL_FROM, HTML_MESSAGE,RCVD_IN_SORBS_SPAM autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:33307) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cbCJi-0006ki-76 for submit@debbugs.gnu.org; Tue, 07 Feb 2017 15:24:46 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57080) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cbCJg-0003fM-SS for bug-grep@gnu.org; Tue, 07 Feb 2017 15:24:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cbCJc-0006bq-2Z for bug-grep@gnu.org; Tue, 07 Feb 2017 15:24:44 -0500 Received: from mout.gmx.net ([212.227.17.22]:56925) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cbCJb-0006ZN-Mj for bug-grep@gnu.org; Tue, 07 Feb 2017 15:24:40 -0500 Received: from [141.201.229.148] ([141.201.229.148]) by mail.gmx.com (mrgmx103 [212.227.17.168]) with ESMTPSA (Nemesis) id 0LpsmR-1byZqY3RDT-00fgKQ for ; Tue, 07 Feb 2017 21:24:34 +0100 To: bug-grep@gnu.org From: "rexkogitans@gmx.at" Subject: Weird output of random files Message-ID: <5feb1e32-16f9-f9a4-b8ee-329958682622@gmx.at> Date: Tue, 7 Feb 2017 21:24:32 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="------------F515E85000731D8AE6D81DED" X-Provags-ID: V03:K0:IiPbn2ZLDHZdntT2x/4TGq/zWhwVSgSogkhgmS8NFWtkesAmJX4 mBX1z3Au3e/5eLfujVRbujZTWAEiMl35ROS3Cn8qkNny+PKZ4EdhQrY4XgikLgxVfayoX9+ GEs6jHxMQYDGjuxxuxZPEDvRQ9Eerxs44TSQKCmtGsrlKFvYSkoA5lc2E42o4rWAeFmwsR9 ZRLhFdf8r5t76y1nzp3HA== X-UI-Out-Filterresults: notjunk:1;V01:K0:9/Ut4HlpZjU=:p31zrX/7Et9gl8S0Mowek1 eZWx8IFb8M5FgB4ktxgNxV5Ku3ryd81YoOYx03rqbLak8IebGiFMDRTr5OeMxDZ6z8lEpHbT0 nEiJJHCY+8053cJ5FswJkbWaffXBvZSGZ2xd1v6cY7AqhwBulm1yx2pPIPjN1Aks4jR32vwP8 +Vrs0dWfUCydBdZbl5aNH9PFiwkjdGB4kmCoZidA/tKpup+WiuHEixhenfnDh70YA2wVcd9j3 5ds854vNqiR1MHIOsRoZJWm7RJd4aO7huA/gC+CNrz+Zd/bf+s5oGa8Di/9rhS7wVdNi64uTO 7GgBlQhQxz/+S2k040Jozgyk5RmTe7ozpyOZPsMkOJqtgofjDV6ejoUpdBB7jPEScIlVwVxPI tsGaM4THvmicxKozDL+/mHw7+am4wFtS3KsRgZFGNeD7excoasds3t64d/az8ECSFl7THYXjQ 82waJvAjVmHCRgRWfOb+is7v3s+w9WVp9d8swAEBsD9z6dKbvVcTbKHcYngw8HLgppX7/lanD ivS7VTeG4gTHvyfTSszxSdYBGBwdEKDSb3popyGiDIAf4Em5lcKepRMfgs/qQVvTrl6MSavFQ bUDdNoSCH5pt47wiJXhZHPEOZA6pCd7yH5Jhsfpuuy99DCxEyxnrQy5ym8iOaCcAwbsY/mwdd KqJEv94TP0E+E1DnwYM7sk80GFaw91rMqCYA0twqSi8jBvcCtwOMJfZDYzk4vciKV2RxmrxvE b6jMKw7MvGAP3pcV+hBeeiTMiEh0zu861BxBnK9c1NRHmaktsJj6R26CZyOINrMKNQ/NmjNFL uDifrZ6w+BdDEPwMhQOhXrzP+T4Oa2tDtxSPu5LcCMqr0jlIdjgSHe4LkOjcbMbfPmCkT7g+w 1jllf2teU0rQzpHAQluWvU9DZRyEo2ZohchmXX3bba+0FIeDNbft+XipIcYAOKWYU4HLT+fb5 q05U9+Iuk+J524vQPhE0KmYbzX1Nqbu2NEA/hph2krdVdubyneuqbnagT6x7+roUKQkXSndOO 1CkjWOVAFaLv5aXHLiX0uY4= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [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.6 (---) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Tue, 07 Feb 2017 15:31:08 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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: -3.6 (---) This is a multi-part message in MIME format. --------------F515E85000731D8AE6D81DED Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Hello, I could repeatedly reproduce an unexpected behaviour on several Linux systems (two installations of Arch Linux [newest state], a Debian [8.7] and a Ubuntu [16.4]). I ran the following command - when I first ran it, it was accidentially ps ax | grep -reh I wanted to grep for processes containing the string "-reh", but forgot the "-e" which was necessary due to the leading dash in the string. On all systems, grep outputs hundreds of (not even matching) lines from files of my home directory, not at all related to the output of ps, which I piped into grep. Maybe, the command line is interpreted as: * r ... search files recursively in directories. Note, that input is read from stdin here. * e ... use the following pattern * h ... this is the pattern expected by "e" It may be that all the lines ouput by grep contain "h". Although expected to be identical, this command works as expected: ps ax | grep -reh /dev/stdin Kind regards, rexkogitans --------------F515E85000731D8AE6D81DED Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 7bit

Hello,

I could repeatedly reproduce an unexpected behaviour on several Linux systems (two installations of Arch Linux [newest state], a Debian [8.7] and a Ubuntu [16.4]).

I ran the following command - when I first ran it, it was accidentially

ps ax | grep -reh

I wanted to grep for processes containing the string "-reh", but forgot the "-e" which was necessary due to the leading dash in the string.

On all systems, grep outputs hundreds of (not even matching) lines from files of my home directory, not at all related to the output of ps, which I piped into grep.

Maybe, the command line is interpreted as:

* r ... search files recursively in directories. Note, that input is read from stdin here.

* e ... use the following pattern

* h ... this is the pattern expected by "e"

It may be that all the lines ouput by grep contain "h".

Although expected to be identical, this command works as expected:

ps ax | grep -reh /dev/stdin
Kind regards,

rexkogitans


--------------F515E85000731D8AE6D81DED-- ------------=_1486506723-19943-1-- From unknown Sun Aug 17 22:07:50 2025 X-Loop: help-debbugs@gnu.org Subject: bug#25651: closed (Re: bug#25651: Weird output of random files) Resent-From: "rexkogitans@gmx.at" Original-Sender: "Debbugs-submit" Resent-CC: bug-grep@gnu.org Resent-Date: Wed, 08 Feb 2017 21:33:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25651 X-GNU-PR-Package: grep X-GNU-PR-Keywords: To: 25651@debbugs.gnu.org Received: via spool by 25651-submit@debbugs.gnu.org id=B25651.14865895342742 (code B ref 25651); Wed, 08 Feb 2017 21:33:02 +0000 Received: (at 25651) by debbugs.gnu.org; 8 Feb 2017 21:32:14 +0000 Received: from localhost ([127.0.0.1]:60579 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cbZqX-0000i9-SU for submit@debbugs.gnu.org; Wed, 08 Feb 2017 16:32:14 -0500 Received: from mout.gmx.net ([212.227.15.15]:60266) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cbZXe-0000G7-RD for 25651@debbugs.gnu.org; Wed, 08 Feb 2017 16:12:43 -0500 Received: from [10.225.34.41] ([178.115.130.155]) by mail.gmx.com (mrgmx001 [212.227.17.190]) with ESMTPSA (Nemesis) id 0MBVwM-1ckxk217XK-00AXSJ for <25651@debbugs.gnu.org>; Wed, 08 Feb 2017 22:12:36 +0100 References: <12aa46c3-7684-1b69-dde1-ff45211736b2@cs.ucla.edu> <5feb1e32-16f9-f9a4-b8ee-329958682622@gmx.at> From: "rexkogitans@gmx.at" Message-ID: <4b334281-3076-287a-6d86-94c43de529aa@gmx.at> Date: Wed, 8 Feb 2017 22:12:33 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:kUx//b3vyjRwFoAH/QSi1rsg6SVsNdq3tFa28oCp1KlpRwtvFPl 0o6CIEsxGobyD0PeH/Q0n3+unmr+6ttFcykra0r804SSjzjoxTjMliKL/Rr+Wg3Z+k1ZZG/ OyF9QtFGXb2segNtNNoblcYR4yBftYiWPNVcttIVl7mGhJJZA3U+YIxmAoyhiFB+VyiKvT2 WWAX2i7wXzWttzIfOP3vg== X-UI-Out-Filterresults: notjunk:1;V01:K0:WH3sgfQfXho=:+fMmzY8l4qOmEf8Pl/psQH JVZApRRWU8WustxlzR2k9AiMQAy1OaMbF7vKIpVSeyACsx8gEwd5yRPtkAhskL3Io6lc0yEEz ouUY0k0fvnsQWyra9r/LvzQTVQjg/hCYvTp72R7LKmMSrCdvVYANIANrZjJ6Cr1atlw/CCkFz OmlHd0mLII4RWg2crTttROsQgFvXDUuyhgQ7zy30+ED4G46M4hcRPz2J00cjxEhB+/YT61s8G gRYnfiCeUl1Dj4+VZfRrwnJe/kCePfLjbkJt6yBSTjToInRoKOWgoCGeB/XaFZiBzww4EB9bP MeTXxdHUEgAMnyFSXhx2WkXde3jgRZaL1iVgnsMocSezfmHyM+gDRp4mbO7xBIGfiRlugzWS0 eAgciRwg/ney2iYiOIMUkadUwu3HkpS5gGJ9eOQw9zP8eSVtPNAPin0XSFY/c0V8v+SqaEh92 Hr5nzzsGhhycLDt1LyPzBbvQGtbYw68A6RddR4T1A3gbCWIEVWtS8UgE9W3FumC7yeJ5jsO42 nw7IyIC+HLSAcxlvfVsrH4EvKrRUZUOaysVh/B8k6HxHANDMHsJi26Kue1OZV0v7iB2+rbmZC SJcGf88BQ7QTBU1/+ApX4AYGZ6MdqboIqbH/v22BvIk38iqfOVPa1Pt7Sg/T7gdaip3X/w4Wu W6MrFQctGH/t3JqpMHR3GL7bIXYSFJ/2e7237DqaxkR0NI+X3diMIMXlgAifxlMJ0QR4IHna4 5klzRBCegYe8G/CE+epE+rrprm4t7OenT5E9vPrxNKiNnEpTApYnTzhQ/bzKgtKeIEFnmAlXE ivs1+eUTRfq0BpGjN0OiLcn36E5iw== X-Spam-Score: -2.6 (--) X-Mailman-Approved-At: Wed, 08 Feb 2017 16:32:12 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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: -2.6 (--) Thanks for the clearance, but this behaviour is very ... unexpected. ps ax | grep 0:00 xyz is clear that the second parameter is meant to be interpreted as filename, otherwise it should read ps ax | grep '0:00 xyz' But I was not expecting "." instead of "-" when option -r is in use. Maybe this could be added in the man page. Kind regards, rexkogitans On 2017-02-07 23:32, GNU bug Tracking System wrote: > Your bug report > > #25651: Weird output of random files > > which was filed against the grep package, has been closed. > > The explanation is attached below, along with your original report. > If you require more details, please reply to 25651@debbugs.gnu.org. > From unknown Sun Aug 17 22:07:50 2025 X-Loop: help-debbugs@gnu.org Subject: bug#25651: closed (Re: bug#25651: Weird output of random files) Resent-From: Paul Eggert Original-Sender: "Debbugs-submit" Resent-CC: bug-grep@gnu.org Resent-Date: Wed, 08 Feb 2017 23:36:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25651 X-GNU-PR-Package: grep X-GNU-PR-Keywords: To: "rexkogitans@gmx.at" , 25651@debbugs.gnu.org Received: via spool by 25651-submit@debbugs.gnu.org id=B25651.148659692213583 (code B ref 25651); Wed, 08 Feb 2017 23:36:01 +0000 Received: (at 25651) by debbugs.gnu.org; 8 Feb 2017 23:35:22 +0000 Received: from localhost ([127.0.0.1]:60621 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cbbli-0003X1-B1 for submit@debbugs.gnu.org; Wed, 08 Feb 2017 18:35:22 -0500 Received: from zimbra.cs.ucla.edu ([131.179.128.68]:42268) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cbblg-0003Wn-GV for 25651@debbugs.gnu.org; Wed, 08 Feb 2017 18:35:21 -0500 Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id BEACA16007D; Wed, 8 Feb 2017 15:35:13 -0800 (PST) Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id FWaCuLOe4cFe; Wed, 8 Feb 2017 15:35:13 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 1367B16007F; Wed, 8 Feb 2017 15:35:13 -0800 (PST) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id ESCHXrbCoQMD; Wed, 8 Feb 2017 15:35:13 -0800 (PST) Received: from Penguin.CS.UCLA.EDU (Penguin.CS.UCLA.EDU [131.179.64.200]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id EE32016007D; Wed, 8 Feb 2017 15:35:12 -0800 (PST) References: <12aa46c3-7684-1b69-dde1-ff45211736b2@cs.ucla.edu> <5feb1e32-16f9-f9a4-b8ee-329958682622@gmx.at> <4b334281-3076-287a-6d86-94c43de529aa@gmx.at> From: Paul Eggert Organization: UCLA Computer Science Department Message-ID: <4b5d969d-5bf1-f88d-18d1-3340dc049733@cs.ucla.edu> Date: Wed, 8 Feb 2017 15:35:12 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 MIME-Version: 1.0 In-Reply-To: <4b334281-3076-287a-6d86-94c43de529aa@gmx.at> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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.0 (/) On 02/08/2017 01:12 PM, rexkogitans@gmx.at wrote: > Maybe this could be added in the man page. It is already mentioned there, no? 'grep --help' says "With no FILE, read . if a command-line -r is given, - otherwise." Perhaps the wording could be improved; if so, specific wording suggestions would help. From unknown Sun Aug 17 22:07:50 2025 X-Loop: help-debbugs@gnu.org Subject: bug#25651: closed (Re: bug#25651: Weird output of random files) Resent-From: "rexkogitans@gmx.at" Original-Sender: "Debbugs-submit" Resent-CC: bug-grep@gnu.org Resent-Date: Fri, 10 Feb 2017 20:05:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25651 X-GNU-PR-Package: grep X-GNU-PR-Keywords: To: Paul Eggert , 25651@debbugs.gnu.org Received: via spool by 25651-submit@debbugs.gnu.org id=B25651.148675705216657 (code B ref 25651); Fri, 10 Feb 2017 20:05:02 +0000 Received: (at 25651) by debbugs.gnu.org; 10 Feb 2017 20:04:12 +0000 Received: from localhost ([127.0.0.1]:35021 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ccHQR-0004Ka-Jh for submit@debbugs.gnu.org; Fri, 10 Feb 2017 15:04:12 -0500 Received: from mout.gmx.net ([212.227.17.22]:62673) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ccHQP-0004KL-Vn for 25651@debbugs.gnu.org; Fri, 10 Feb 2017 15:04:10 -0500 Received: from fuchur ([178.115.131.105]) by mail.gmx.com (mrgmx102 [212.227.17.168]) with ESMTPSA (Nemesis) id 0LosFD-1bwK2H3BIh-00gqrX; Fri, 10 Feb 2017 21:03:51 +0100 Message-ID: <1486757024.2940.1.camel@gmx.at> From: "rexkogitans@gmx.at" Date: Fri, 10 Feb 2017 21:03:44 +0100 In-Reply-To: <4b5d969d-5bf1-f88d-18d1-3340dc049733@cs.ucla.edu> References: <12aa46c3-7684-1b69-dde1-ff45211736b2@cs.ucla.edu> <5feb1e32-16f9-f9a4-b8ee-329958682622@gmx.at> <4b334281-3076-287a-6d86-94c43de529aa@gmx.at> <4b5d969d-5bf1-f88d-18d1-3340dc049733@cs.ucla.edu> Content-Type: multipart/alternative; boundary="=-OMNF7V0YCDowlHvEvBdr" X-Mailer: Evolution 3.22.4 Mime-Version: 1.0 X-Provags-ID: V03:K0:cpGleSQjVtRL2aDalVBCbHZJEfRAAAZbrYnf6dxENU8yEqruPaR +pXH0I/weZHLr6nf7Yv4cznJLYDU45JzrC6/apJzhMc8deZUTS1VhCYoCwsoyOESuMbVAJ9 kaniKGoqKowWZ6PleHJ7EdIvOFKcLCN39on5HyXHV6uIDF9xgMq+vtRLCUvXTj4aY64RQCK OGRgxwDY7QGxLCS8/gG3A== X-UI-Out-Filterresults: notjunk:1;V01:K0:nyT2yNlA96A=:KbdGUayKVO47EE7BttNe/b AmC0/Lh4fOyYHP9ObUxQy3WtUMzND5Yr8acP8IOs5Oeh2zFBjGox/hez/0btq/uXXswk5ho2N iK4nLmRONU2DxoSNWRu3rovTvLN1cKhGi1kOlUQG23hWexgBPCKkBtv2/R/8dyVoJ+Rt/hu0q wVw6g+tYIvEqXhq4lYltFBrZOzpLHh1tg48kRQbJm2TP198CNmuK/SHDVX0IQLELouDDcnsp7 /8kLQnoyAN0aCdzkky4Zb1i3vBBd12MHS+z81wV4qwPO9iVw+NB3c6wsgLTNlQ7IDtiqP6ttX Pa4SAtwIEh58GEE3qtSNG6NIyj451o1m4iIaKEZCoVSMq4wzS9uVq102NtO6NrY6mNFlYG7CJ C+VhOsPR/5se54sBbf+Is3uh8ATqB/Qbqw3YxX3uPgSwcTRgH8MLYScdEnvzfkL6n+6Wp4XgP RDpYrO2VRFxdF8WgRNiuSxwt/9ViHfP8AKPeTZYxPWvvDPN/fWDN2hAlvOU8nXVJTOgBtxWvj mdjbSBXh8LFurwEEZVN0CoMo1yB25qniiGv6WyEM1Ot16Du+0YxGhqiR5WkEsenyxr8pNapob RP1AMh1SmspbCjLwTN9OTxGUElmPuxgqncVnRFL9Owu6nkuYyq2FLUy9888oHKvp9XgG0fp07 zoHptjSw85r1XnlFMkk1Rgy/UhuY3ft9XTjOPSzzefsoEOkvdngvoC1xN8eelGYK2FMs7OEUM 2xoa33V3X5BykEk/60wU91SoGZmOvAjGVaDNaC1zMR0Y+JWcfHx1jwkHjQUOf95CTVLg0bnU9 GCuKoR/5oMpNn/wp2nPNuNIeWqHv7w9o7NlHuyjDcxCMZ6Hml4kWtuKxZ341fb089iBr7zQ4i E7GOx7+A2/PG+no/wMIuMmaKifVqWfQcMf87E3R/mguU6KkJOwWf+OM1XNI9aQcxOuNzezfny l3+xyRv/u4KrxcA2ACH5QNdpHKGvKJNAVxUhbKX+c27XV6sJ1ZqyZvhMy1cEjA1U01OeR6R29 LpgkR9RLezvjm/RvarE/nfpVi8MZW7F2kjz9Jv/nRpja8KVmYaUsuno7QOGZM/MtbQ== X-Spam-Score: -2.6 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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: -2.6 (--) --=-OMNF7V0YCDowlHvEvBdr Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hello, Paul, this is correct, it is mentioned in grep --help. However, I always expect the man pages to be more exhaustive. But here, it only says grep searches the named input FILEs for lines containing a match to the given PATTERN.=C2=A0=C2=A0If no files are specified, or if the file =E2=80= =9C-=E2=80=9D is given, grep=C2=A0=C2=A0searches=C2=A0=C2=A0standard=C2=A0=C2=A0input.=C2=A0=C2=A0= =C2=A0Bydefault, grep prints the matching lines. Well, of course, in the description of --recursive, it is mentioned: =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0-r, --recursive=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0Read=C2=A0=C2= =A0all files under each directory, recursively, following symbolic links only if=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0they are on the command line.=C2=A0=C2=A0Note that if no file operand is given, grep searches=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0the working directory.=C2=A0=C2=A0This is equivalent to the -d recurse option. This could be made a bit more consistent. grep searches the named input FILEs for lines containing a match to the given PATTERN.=C2=A0=C2=A0If no files are specified, or if the file =E2=80= =9C-=E2=80=9D is given, grep=C2=A0=C2=A0searches=C2=A0=C2=A0standard=C2=A0=C2=A0input or, by using = the --recursive switch, the current directory.=C2=A0=C2=A0=C2=A0By default, grep prints the matchin= g lines. If I am the first in the world to fall for this, then please consider this discussion as useless. This bug report is closed, anyway. Kind regards,rexkogitans Am Mittwoch, den 08.02.2017, 15:35 -0800 schrieb Paul Eggert: > On 02/08/2017 01:12 PM, rexkogitans@gmx.at wrote: > > Maybe this could be added in the man page. >=20 > It is already mentioned there, no? 'grep --help' says "With no FILE,=C2= =A0 > read . if a command-line -r is given, - otherwise." Perhaps the > wording=C2=A0 > could be improved; if so, specific wording suggestions would help. >=20 --=-OMNF7V0YCDowlHvEvBdr Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable
Hello, Paul,

this is= correct, it is mentioned in grep --help. However, I always expect the man = pages to be more exhaustive. But here, it only says

grep searches the named input FILEs for lines containing a match to the g= iven PATTERN.  If no files are specified, or if the file =E2=80= =9C-=E2=80=9D is given, grep  searches  standard &= nbsp;input.   By
default, grep prints the matching= lines.

Well, of course, in the description of --r= ecursive, it is mentioned:

    = ;  -r, --recursive
      =         Read  all files u= nder each directory, recursively, following symbolic links only if
            &= nbsp; they are on the command line.  Note that if no file op= erand is given, grep searches
      = ;        the working directory.&nbs= p; This is equivalent to the -d recurse option.

This could be made a bit more consistent.

= grep searches the named input FILEs for lines containing a match to the giv= en PATTERN.  If no files are specified, or if the file =E2=80=9C-= =E2=80=9D is given, grep  searches  standard  = ;input or, by using the --recursive switch, the current directory. =   By default, grep prints the matching lines.

If I am the first in the world to fall for this,= then please consider this discussion as useless. This bug report is closed= , anyway.

Kind regards,
rexkogitans

Am Mittwoch, den 08.02.2017, 15:35 -0800 schrieb Paul = Eggert:
On 02/08/2017 01:12 PM, rexkogitans@gmx.at wrote:
Maybe this could be added in the man page.
It is already mentioned there, no? 'grep --help' says "With no FILE,=20 read . if a command-line -r is given, - otherwise." Perhaps the wording=20 could be improved; if so, specific wording suggestions would help.
--=-OMNF7V0YCDowlHvEvBdr-- From unknown Sun Aug 17 22:07:50 2025 X-Loop: help-debbugs@gnu.org Subject: bug#25651: closed (Re: bug#25651: Weird output of random files) Resent-From: Paul Eggert Original-Sender: "Debbugs-submit" Resent-CC: bug-grep@gnu.org Resent-Date: Sun, 12 Feb 2017 21:46:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25651 X-GNU-PR-Package: grep X-GNU-PR-Keywords: To: "rexkogitans@gmx.at" , 25651@debbugs.gnu.org Received: via spool by 25651-submit@debbugs.gnu.org id=B25651.148693592631939 (code B ref 25651); Sun, 12 Feb 2017 21:46:02 +0000 Received: (at 25651) by debbugs.gnu.org; 12 Feb 2017 21:45:26 +0000 Received: from localhost ([127.0.0.1]:37493 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cd1xV-0008J4-KK for submit@debbugs.gnu.org; Sun, 12 Feb 2017 16:45:25 -0500 Received: from zimbra.cs.ucla.edu ([131.179.128.68]:47670) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cd1xT-0008Im-Gx for 25651@debbugs.gnu.org; Sun, 12 Feb 2017 16:45:24 -0500 Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id A32B3160087; Sun, 12 Feb 2017 13:45:17 -0800 (PST) Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id sbAIaYDG4oAg; Sun, 12 Feb 2017 13:45:16 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 8DF24160089; Sun, 12 Feb 2017 13:45:16 -0800 (PST) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id hD9pQm1x_wp7; Sun, 12 Feb 2017 13:45:16 -0800 (PST) Received: from [192.168.1.9] (unknown [47.153.188.248]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 6F60C160087; Sun, 12 Feb 2017 13:45:16 -0800 (PST) References: <12aa46c3-7684-1b69-dde1-ff45211736b2@cs.ucla.edu> <5feb1e32-16f9-f9a4-b8ee-329958682622@gmx.at> <4b334281-3076-287a-6d86-94c43de529aa@gmx.at> <4b5d969d-5bf1-f88d-18d1-3340dc049733@cs.ucla.edu> <1486757024.2940.1.camel@gmx.at> From: Paul Eggert Organization: UCLA Computer Science Department Message-ID: <09d166ca-e973-af20-c914-e6663b5648d2@cs.ucla.edu> Date: Sun, 12 Feb 2017 13:45:16 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 MIME-Version: 1.0 In-Reply-To: <1486757024.2940.1.camel@gmx.at> Content-Type: multipart/mixed; boundary="------------08AB2339890A1B5A8DC157EF" X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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.0 (/) This is a multi-part message in MIME format. --------------08AB2339890A1B5A8DC157EF Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit rexkogitans@gmx.at wrote: > This could be made a bit more consistent. Fair enough, I installed the attached. --------------08AB2339890A1B5A8DC157EF Content-Type: text/x-diff; name="0001-doc-clarify-default-input-Bug-25651.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="0001-doc-clarify-default-input-Bug-25651.patch" >From 96e100ad23ec85bf602064298bf86b22cb358525 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sun, 12 Feb 2017 13:43:01 -0800 Subject: [PATCH] doc: clarify default input (Bug#25651) * doc/grep.in.1: * src/grep.c (usage): Clarify default input when -r. * src/grep.c (usage): Do not bother documenting egrep and fgrep; the manual is enough. --- doc/grep.in.1 | 20 ++++++++++++-------- src/grep.c | 16 ++++++---------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/doc/grep.in.1 b/doc/grep.in.1 index e3472f7..ed6382b 100644 --- a/doc/grep.in.1 +++ b/doc/grep.in.1 @@ -43,15 +43,19 @@ grep, egrep, fgrep \- print lines matching a pattern . .SH DESCRIPTION .B grep -searches the named input -.IR FILE s -for lines containing a match to the given -.IR PATTERN . -If no files are specified, or if the file +searches for +.I PATTERN +in each +.IR FILE . +A +.I FILE +of .RB "\*(lq" \- "\*(rq" -is given, -.B grep -searches standard input. +stands for standard input. +If no +.I FILE +is given, recursive searches examine the working directory, +and nonrecursive searches read standard input. By default, .B grep prints the matching lines. diff --git a/src/grep.c b/src/grep.c index 74acb0b..5bc4cd5 100644 --- a/src/grep.c +++ b/src/grep.c @@ -1928,16 +1928,15 @@ usage (int status) else { printf (_("Usage: %s [OPTION]... PATTERN [FILE]...\n"), getprogname ()); - printf (_("Search for PATTERN in each FILE or standard input.\n")); - printf (_("PATTERN is, by default, a basic regular expression (BRE).\n")); + printf (_("Search for PATTERN in each FILE.\n")); printf (_("\ Example: %s -i 'hello world' menu.h main.c\n\ \n\ -Regexp selection and interpretation:\n"), getprogname ()); +Pattern selection and interpretation:\n"), getprogname ()); printf (_("\ - -E, --extended-regexp PATTERN is an extended regular expression (ERE)\n\ + -E, --extended-regexp PATTERN is an extended regular expression\n\ -F, --fixed-strings PATTERN is a set of newline-separated strings\n\ - -G, --basic-regexp PATTERN is a basic regular expression (BRE)\n\ + -G, --basic-regexp PATTERN is a basic regular expression (default)\n\ -P, --perl-regexp PATTERN is a Perl regular expression\n")); /* -X is deliberately undocumented. */ printf (_("\ @@ -2011,11 +2010,8 @@ Context control:\n\ (MSDOS/Windows)\n\ \n")); printf (_("\ -'egrep' means 'grep -E'. 'fgrep' means 'grep -F'.\n\ -Direct invocation as either 'egrep' or 'fgrep' is deprecated.\n")); - printf (_("\ -When FILE is -, read standard input. With no FILE, read . if a command-line\n\ --r is given, - otherwise. If fewer than two FILEs are given, assume -h.\n\ +When FILE is '-', read standard input. With no FILE, read '.' if\n\ +recursive, '-' otherwise. With fewer than two FILEs, assume -h.\n\ Exit status is 0 if any line is selected, 1 otherwise;\n\ if any error occurs and -q is not given, the exit status is 2.\n")); emit_bug_reporting_address (); -- 2.7.4 --------------08AB2339890A1B5A8DC157EF--