[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
grep counting matches only with --color argument
From: |
Tomas Hlavaty |
Subject: |
grep counting matches only with --color argument |
Date: |
Sun, 28 Feb 2021 00:07:30 +0100 |
Hi,
why does this command shows the number of matches in the mode-line
(grep "grep -r --color -nH -e TODO ~/git/emacs-pdf")
but this one (without --color argument) always shows 0?
(grep "grep -r -nH -e TODO ~/git/emacs-pdf")
Is there a deeper reason that --color is required to see the number of
matches? Could it simply count the number of matched lines if no
--color was specified? Or is it not easy to detect?
I would like to see the number of matches with alternative programs like
ripgrep:
(grep "rg -nH --no-heading --color=always -e TODO ~/git/emacs-pdf")
(grep "rg -nH --no-heading --color=ansi -e TODO ~/git/emacs-pdf")
But the --color argument here does not seem to have an effect.
Thanks in advance,
Tomas
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- grep counting matches only with --color argument,
Tomas Hlavaty <=