为什么这个 "can't break line" 来自 gcc 手册页的 grep 警告?

Why is this "can't break line" warning from grep of gcc man page?

我试图使用以下命令查找以 -s 结尾的行,但收到​​警告:

$ man gcc | grep '\-s$'
<standard input>:4808: warning [p 54, 13.2i]: can't break line
$ man gcc | egrep '\-s$'
<standard input>:4808: warning [p 54, 13.2i]: can't break line

下面是我的开发环境:

$ uname -a
Linux localhost 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt20-1+deb8u1 (2015-12-14) x86_64 GNU/Linux

$ gcc --version
gcc (Debian 4.9.2-10) 4.9.2
Copyright (C) 2014 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

通常man 格式化内容以匹配终端的宽度。您将其输出重定向到没有 "screen width" 的管道,因此它使用默认宽度 80 个字符进行格式化。 某些手册页的表格宽度超过 80 个字符,因此您会收到此 "can't break line" 警告。 试试这个:

$ MANWIDTH=160 man gcc | grep '\-s$'