在传统的Windows shell中,我可以使用net helpmsg
从退出状态代码中获取基于字符串的消息。例如,如果我想知道2的状态意味着什么,我会做以下事情:
INPUT COMMMAND: net helpmsg 2
输出: The system cannot find the file specified.
我想知道:Bash中是否有等效函数(其中我传递了错误代码并返回了一个字符串)?
谢谢!
答案 0 :(得分:1)
MySQL提供perror
,它处理操作系统和MySQL错误代码。
$ perror 2
OS error code 2: No such file or directory