可以 : echo "yourpasswd" |sudo -S yourcommand
但是不安全,因為密碼都顯示在shell腳本里面了-_-
原文: http://hi.baidu.com/mgqw/blog/item/2824bb01ccd5570a7aec2cd9.html
但是不安全,因為密碼都顯示在shell腳本里面了-_-
原文: http://hi.baidu.com/mgqw/blog/item/2824bb01ccd5570a7aec2cd9.html