我正在使用返回此错误代码的 pylint 实用程序:
Pylint should leave with following status code:
* 0 if everything went fine
* 1 if a fatal message was issued
* 2 if an error message was issued
* 4 if a warning message was issued
* 8 if a refactor message was issued
* 16 if a convention message was issued
* 32 on usage error
status 1 to 16 will be bit-ORed so you can know which different
categories has been issued by analysing pylint output status code
现在我需要确定 Bash 中是否出现了致命或错误消息。怎么做?我想我需要位操作;-)
编辑:我知道我需要按位执行第三 (3) 号并针对 null 进行测试以查看是否发出了致命消息或错误消息。我的问题很简单:用 bash 语法来做。输入是 $?,输出又是 $? (例如使用测试程序)。谢谢!