Subject: Re: bug#65416: Feature request: include first line of file in output

From: Carlo Arenas <[email-masked]>
Date: Tue, 22 Aug 2023 23:20:19 -0700

> Daniel Green <[email-masked]> 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