Output line-number of matches when acking a single file

56 views
Skip to first unread message

Ingmar Vanhassel

unread,
Jun 14, 2009, 11:20:51 AM6/14/09
to ack-users
Can ack output the line-number of matches, when it's only scanning a
similar file?
In grep terms this boils down to 'grep --line-number pattern file', ack
only seems to output this format (automatically) when it's matching
against multiple lines. I'd like to be able to do the same for a single
file too.

-Ingmar

--
Exherbo KDE, X.org maintainer

Ingmar Vanhassel

unread,
Jun 14, 2009, 11:31:10 AM6/14/09
to ack-users
Excerpts from Ingmar Vanhassel's message of Sun Jun 14 17:20:51 +0200 2009:

Just saw that this ticket is what I'm looking for:
http://code.google.com/p/ack/issues/detail?id=131

Well, consider it a gently "me too", and sorry for the noise...

Bill Ricker

unread,
Jun 14, 2009, 1:51:22 PM6/14/09
to ack-...@googlegroups.com
the same workaround as used on older grep works, append name of an empty file

ack -i grid mhtest.pl /dev/null

(on Unix derived OSs /dev/null is the canonical empty file, and bits trashcan)

bill


Bill
n1...@arrl.net bill....@gmail.com

Ingmar Vanhassel

unread,
Jun 14, 2009, 3:13:37 PM6/14/09
to ack-users
Excerpts from Bill Ricker's message of Sun Jun 14 19:51:22 +0200 2009:

Ah, clever. Thanks :)

Bill Ricker

unread,
Jun 14, 2009, 3:47:52 PM6/14/09
to ack-...@googlegroups.com
On Sun, Jun 14, 2009 at 3:13 PM, Ingmar Vanhassel<ing...@exherbo.org> wrote:
> Ah, clever. Thanks :)

to me it's just old-school ?

--
Bill
n1...@arrl.net bill....@gmail.com

Reply all
Reply to author
Forward
0 new messages