bug-grep
[Top][All Lists]
Advanced

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

Re: Output only line number


From: Benno Schulenberg
Subject: Re: Output only line number
Date: Wed, 01 Nov 2006 00:20:09 +0100
User-agent: KMail/1.9.5

PurdueHassen wrote:
> Is it possible to have grep output the line number without
> returning any data in the line containing a match?

function ngrep { grep -n "$@" | sed 's/:.*//'; }

When ngrep should be able to search multiple files, the function 
gets a little more complicated.

Benno




reply via email to

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