使用bash ,执行的最后一个东西的退出代码存储在$? shellvariables:
foo bar echo $? # prints exit code of `bar` baz echo $? # prints exit code of `baz`
如果我在Windows下运行cmd脚本,是否有相当的方法来获得这个值? (注意:像是运行一个Python脚本,然后调用自己的库函数,这不是我在这里之后的事情。)
%ERRORLEVEL%在Windows中是等效的。