例如判断apt命令是否存在

if command -v apt > /dev/null 2>&1; then
APT=apt;
else
APT=yum;
fi
echo $APT