批踢踢實業坊
›
看板
Linux
關於我們
聯絡資訊
返回看板
作者
yshihyu (yshihyu)
看板
Linux
標題
[問題] script 判斷ubuntu 套件
時間
Sat Sep 1 21:12:13 2012
我想再shell script 中判斷某個ubuntu 套件是否存在 例如是 ssh 這套件, 請問應該要如何寫? 謝謝 --
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 123.204.0.32
推
rehon
:apt-cache show
09/01 21:15
→
yshihyu
:這樣怎麼用在判斷?? if [`apt-cache show xxx` != ""]
09/01 22:14
→
yshihyu
:這樣好像也不行
09/01 22:14
推
rehon
:if apt-cache show ssh > /dev/null ;then echo exist; fi
09/01 22:48
→
kdjf
:dpkg -L ssh
09/02 01:08