|
From: | GNU bug Tracking System |
Subject: | [debbugs-tracker] bug#22656: closed (How to grep two patterns in a line with correct coloring?) |
Date: | Mon, 11 Apr 2016 04:46:02 +0000 |
Your message dated Sun, 10 Apr 2016 21:45:49 -0700 with message-id <address@hidden> and subject line Re: How to grep two patterns in a line with correct coloring? has caused the debbugs.gnu.org bug report #22656, regarding How to grep two patterns in a line with correct coloring? to be marked as done. (If you believe you have received this mail in error, please contact address@hidden) -- 22656: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=22656 GNU Bug Tracking System Contact address@hidden with problems
--- Begin Message ---Subject: How to grep two patterns in a line with correct coloring? Date: Sat, 13 Feb 2016 18:10:01 -0600 Hi, I know that I can use this to grep two patterns. But it can not highlight both patterns. grep word1 FILE | grep word2 Or I can use the following. But it is cumbersome as I have to type word1 and word2 twice. And this method is not scale if I want grep multiple patterns. The coloring can not be just for word1 and word2 only. grep -E 'word1.*word2|word2.*word1' logs Could anybody let me know what is the best way to grep two patterns in a line with correct coloring? Thanks. -- Regards, Peng
--- End Message ---
--- Begin Message ---Subject: Re: How to grep two patterns in a line with correct coloring? Date: Sun, 10 Apr 2016 21:45:49 -0700 User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 This works for me: grep --color=always -E 'word1|word2'
--- End Message ---
[Prev in Thread] | Current Thread | [Next in Thread] |