All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeffrey Holle <jeff.holle@verizon.net>
To: linux-console@vger.kernel.org
Subject: using grep with both -l and -n
Date: Thu, 19 Feb 2004 16:00:07 -0800	[thread overview]
Message-ID: <c13irp$6lf$1@sea.gmane.org> (raw)

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.



             reply	other threads:[~2004-02-20  0:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-02-20  0:00 Jeffrey Holle [this message]
2004-02-20  3:04 ` using grep with both -l and -n Mike Castle

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='c13irp$6lf$1@sea.gmane.org' \
    --to=jeff.holle@verizon.net \
    --cc=linux-console@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.