Re: [PATCH/RFC 0/4] grep: support to match by line number

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

 



Junio C Hamano <gitster@xxxxxxxxx> writes:

> I am personally not thrilled by what this series attempts to do, but first
> a few questions:
> 
>  - Are there existing non-git "grep" implementations that do this?
> 
>  - If yes:
>    - what command option letter do they use to specify line number?
>    - do they not support a range notation (e.g. -@ 25-30,32-40)?
>    - what do they do when given more than one file?

I'm not sure if it is exactly the same as '-@' in Bert proposal, but
"ack", grep-like text finder in Perl (http://betterthangrep.com or
http://p3rl.org/ack), includes the following command line option:

  --line=NUM

    Only print line NUM of each file. Multiple lines can be given with
    multiple --line options or as a comma separated list
    (--line=3,5,7). --line=4-7 also works. The lines are always output in
    ascending order, no matter the order given on the command line.

-- 
Jakub Narebski
Poland
ShadeHawk on #git
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]