shell中,我们可以通过简单的一个判断来判断命令是否存在

shell中,我们可以通过简单的一个判断来判断命令是否存在

which "Command" > /dev/null
if [ $? -eq 0 ]
then
    echo command is exist
else
    echo command not exist
fi
原文地址:https://www.cnblogs.com/huochaihe/p/9309966.html