合规国际互联网加速 OSASE为企业客户提供高速稳定SD-WAN国际加速解决方案。 广告
# Linux检测命令是否存在 如果要兼容POSIX的话可以使用command: ~~~ command -v <the_command> ~~~ 示例: ~~~ if ! [ -x "$(command -v git)" ]; then   echo 'Error: git is not installed.' > &2   exit 1 fi ~~~ bash环境可以使用hash 或 type: ~~~ hash <the_command>  type <the_command>  ~~~ 示例:检查gdate是否存在 ~~~ gnudate() {     if hash gdate 2>/dev/null; then         gdate "$@"     else         date "$@"     fi } ~~~