📜  检查依赖关系 BASH - Shell-Bash 代码示例

📅  最后修改于: 2022-03-11 14:51:24.651000             🧑  作者: Mango

代码示例1
#!/bin/bash
echo -n "Checking dependencies... "
for name in youtube-dl yad ffmpeg
do
  [[ $(which $name 2>/dev/null) ]] || { echo -en "\n$name needs to be installed. Use 'sudo apt-get install $name'";deps=1; }
done
[[ $deps -ne 1 ]] && echo "OK" || { echo -en "\nInstall the above and rerun this script\n";exit 1; }