NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: grep "--color=always" doesn't (always) work with "-i"



On 22/10/2020 10:47, Ottavio Caruso wrote:
Hi,

$ uname -a
NetBSD NetBSD 9.0_STABLE NetBSD 9.0_STABLE (GENERIC) #0: Sat May  9 08:21:36 UTC 2020 mkrepro%mkrepro.NetBSD.org@localhost:/usr/src/sys/arch/amd64/compile/GENERIC amd64

My shell is ksh.


/usr/bin/grep --color=always "DUID" -r /usr/share/man/man*

correctly returns all manual page lines with "DUID" highlighted in red, where as:

grep -r -i duid /usr/share/man/man*

returns all manual page lines with case insensitive "duid" but without highlighting. I have tried to play around with the orders of parameters and removing quotes, without success.

As a term of comparison, the same command works as intended on OpenBSD and Linux.

Am I doing something wrong or is it a bug?

Forgot to add:

/usr/bin/grep --color=always "duid" -r /usr/share/man/man*

== colorizes, whereas:

/usr/bin/grep --color=always "DUID" -r /usr/share/man/man*

== doesn't colorize.

For the time being, I'll stick with the former syntax, but I'm baffled as to why the latter doesn't work.


--
Ottavio Caruso


Home | Main Index | Thread Index | Old Index