2016-08-21 38 views
0

我的密碼保護配置文件在我的Mac上,我想通過終端刪除。當運行命令:從終端刪除帶密碼保護的個人資料

profiles -R -p MyProfile 

終端問我的個人資料密碼:

Enter the profile removal password: 

現在我必須鍵入密碼(無管理員密碼)手動到終端。是否可以創建一個包含密碼的命令,以便配置文件自動刪除?

+0

你嘗試一下用'分離;'或''&&? – msumera

+0

是的,終端仍然要求輸入密碼 – Megaetron

+0

如果您想使交互式命令非交互,您通常會使用expect:http://stackoverflow.com/tags/expect/info –

回答

1

man 1 profiles

-z The profile removal password. If not specified and the profile requires 
    a removal password, you will be prompted. 

所以我猜你需要讓你的命令看起來像

profiles -R -p MyProfile -z MyProfilePassword