bug-grep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Carlo Arenas
Subject: bug#65416: Feature request: include first line of file in output
Date: Tue, 22 Aug 2023 23:20:19 -0700

> Daniel Green <ddgreen@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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]