GNU bug report logs - #65416
Feature request: include first line of file in output

Previous Next

Package: grep;

Reported by: Daniel Green <ddgreen <at> gmail.com>

Date: Mon, 21 Aug 2023 07:16:02 UTC

Severity: wishlist

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Carlo Arenas <carenas <at> gmail.com>
To: arnold <at> skeeve.com
Cc: ddgreen <at> gmail.com, 65416 <at> debbugs.gnu.org
Subject: bug#65416: Feature request: include first line of file in output
Date: Tue, 22 Aug 2023 23:20:19 -0700
> Daniel Green <ddgreen <at> gmail.com> wrote:
>
> > I've never looked at the grep source code
> > before, but could be tempted to try implementing it myself if there was any
> > chance of the path being accepted.

A slightly more complicated perl script would be my first choice if
coding is the solution, but grep already has a feature that could be
used to provide a solution as shown by the following scriptlet
(including an scaled data file) :

$ cat > c.csv
USER,TIP
john,0
jane,10
carenas,100
$ ( grep -m1 USER && grep carenas ) < c.csv
USER,TIP
carenas,100

Carlo




This bug report was last modified 1 year and 321 days ago.

Previous Next


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