.sh脚本判断进程
count=$(lsof -i:8888 -t|wc -l) #将8888端口的进程总数赋给count
if [ KaTeX parse error: Expected 'EOF', got '#' at position 15: count -eq 0 ] #̲ 如果count为0 then…(lsof -i:8888 -t|wc -l)
if [ $count2 -eq 0 ]
then
echo ‘Start Success!’ # 打印提示信息
else
echo ‘Faild! Please try again’
fi
else
sudo kill -9 KaTeX parse error: Expected 'EOF', got '#' at position 19: …of -i:8888 -t) #̲ 使用管理员权限杀掉8888的…(lsof -i:8888 -t|wc -l)
if [ $count1 -eq 0 ]
then
echo ‘Start Success!’
else
echo ‘Please try again’
fi
fi