0
我想編寫一個bash腳本,查看security list-keychains
以查看是否有名爲appledev的鑰匙串。如果沒有鑰匙串,我想用這個創建它security create-keychain -p foo appledev
Bash如果條件
我試圖這樣的東西,但它是可笑的不正確。
APPLEDEVKEYCHAIN=`security list-keychains | grep appledev`
if [[$APPLEDEVKEYCHAIN -eq 1]]; then
echo "Using keychain ${APPLEDEVKEYCHAIN}"
else
echo "Creating Keychain appledev"
security create-keychain -p foo appledev
fi
exit