如果命令行中指定的某些库不存在,Binutils中的经典“ar”工具不会失败。它只显示消息“ar:< library_name> .a:没有这样的文件或目录”,但……
适合我:
$ ar unknown.a 2>/dev/null || echo 'ko' ko $ ar -V GNU ar (GNU Binutils) 2.28.0.20170506 Copyright (C) 2017 Free Software Foundation, Inc. This program is free software; you may redistribute it under the terms of the GNU General Public License version 3 or (at your option) any later version. This program has absolutely no warranty.
可能你的版本 ar 太老了。
ar