From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 24383 invoked from network); 4 Feb 2022 10:13:18 -0000 Received: from 4ess.inri.net (216.126.196.42) by inbox.vuxu.org with ESMTPUTF8; 4 Feb 2022 10:13:18 -0000 Received: from mimir.eigenstate.org ([206.124.132.107]) by 4ess; Thu Feb 3 20:49:11 -0500 2022 Received: from abbatoir.myfiosgateway.com (pool-74-108-56-225.nycmny.fios.verizon.net [74.108.56.225]) by mimir.eigenstate.org (OpenSMTPD) with ESMTPSA id cc91ef24 (TLSv1.2:ECDHE-RSA-AES256-SHA:256:NO) for <9front@9front.org>; Thu, 3 Feb 2022 16:48:35 -0800 (PST) Message-ID: <478C7C11218F1901581B8128FCBDC56C@eigenstate.org> To: 9front@9front.org Date: Thu, 03 Feb 2022 19:48:34 -0500 From: ori@eigenstate.org In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit List-ID: <9front.9front.org> List-Help: X-Glyph: ➈ X-Bullshit: proven SOAP over ACPI replication information standard Subject: Re: [9front] grep: always show path with '-n' Reply-To: 9front@9front.org Precedence: bulk Quoth Nicola Girardi : > Quoth ori@eigenstate.org: > > Quoth Steve Simon : > > > the “traditional” way to achieve this is for g(1) to always pass > > > /dev/null to grep to ensure there are always multiple files. > > > > > > > That's certainly *an* option, but it > > seems surprising that 1 vs n args are > > treated differently for '-n', and I > > think it makes sense to make it > > consistent. > > I've always wondered about that behavior for '-n'. Does anyone know > the historical reason for omitting the file name when there's only one > file to search? > It removes a processing step to remove a prefix, I guess. This doesn't change that behavior -- it just makes '-n' always prefix 'file:line' instead of just 'line'.