问题描述
正常状态下,“ip route show”命令的显示结果中,ip地址会加粗,但是使用su -l root或者su -命令登陆root账户的login shell之后,如果使用同样的命令,得到的结果中ip地址不会加粗,十分奇怪,如下图所示:

原因分析:
经过研究,是“ip route show”命令在两种环境下输出的结果中包含的非控制字符不同。如下图所示。

查阅ip命令的手册,显示:
-c[color][={always|auto|never}
Configure color output. If parameter is omitted or always, color output is enabled regardless ofstdoutstate. If parameter isauto,stdoutis checked to be a terminal before enabling color output. If parameter isnever, color output is disabled. If specified multiple times, the last one tak


634

被折叠的 条评论
为什么被折叠?



