Some man implementations would call roff in a way that those sequences are not used (or internally call col -b -p -x to strip them like in the case of the man-db implementation (unless the MAN_KEEP_FORMATTING environment variable is set as noted by @Kusalananda)), and don't invoke a pager when they detect the output is not going to a terminal (so man bash | grep NAME would work there), but not yours.
remove reference to @K's answer to avoid confusion as he has now removed that part.
Stéphane Chazelas
- 586.2k
- 96
- 1.1k
- 1.7k