我试图比较这个,无论是否有进程,结果始终为false
output=$(minikube ssh 'ps -ef | grep dashboard | grep -v grep | wc -l')
if [[ "$output" == 0 ]]; then
echo "Starting minikube dashboard"
else
echo "Minikube dashboard already has been started"
fi
有趣的时刻:
$echo $output
1
$echo "$output smth"
smth
那么功能输出是怎么回事?