All of lore.kernel.org
 help / color / mirror / Atom feed
* using grep with both -l and -n
@ 2004-02-20  0:00 Jeffrey Holle
  2004-02-20  3:04 ` Mike Castle
  0 siblings, 1 reply; 2+ messages in thread
From: Jeffrey Holle @ 2004-02-20  0:00 UTC (permalink / raw)
  To: linux-console

I've actually got two questions about grep.

First, can the -l, which just prints the matching filenames, and -n, 
which includes the matched line number using the syntax 
"filename:lineno", be combined to affect.

What I find is that adding -n makes inclusion of -l a noop.

The reason I ask is I'm using grep to generate .gdbinit files.  the 
syntax that -n emits is right on, except for the extra stuff that is 
normally suppressed by -l.

The second question is there a way to defeat the default behavior of not 
including the filename when -n is used and only one file is included in 
the search?  In this case, it prints just the lineno.



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-02-20  3:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-02-20  0:00 using grep with both -l and -n Jeffrey Holle
2004-02-20  3:04 ` Mike Castle

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.