GNU bug report logs - #24382
grep should support -l and -n together

Previous Next

Package: grep;

Reported by: Mathieu Jobin <somekool <at> gmail.com>

Date: Tue, 6 Sep 2016 15:36:02 UTC

Severity: wishlist

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Mathieu Jobin <somekool <at> gmail.com>
To: bug-grep <at> gnu.org
Subject: grep should support -l and -n together
Date: Tue, 6 Sep 2016 10:36:22 -0400
[Message part 1 (text/plain, inline)]
I like using

> grep -rn pattern dir

a lot because it returns all the result with the line numbers
I think its one of the most common use case of grep.

recently I started using

> grep -rl pattern dir

only returning the list of files, without the content appended.
I find that really useful

but when using -rl , -n is ignored, which is sad, because I could pipe in
my editor and it would open the files at the proper line

for example

> grep -rln "[^a-z]if .\+ = .\+" app  | xargs kate

unfortunately, the line numbers is not present on the grep output here


should you chose not to support this, then it should probably error out

cheers,


-- 
Mathieu Jobin
[Message part 2 (text/html, inline)]

This bug report was last modified 8 years and 288 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.