Fork me on GitHub

 

可以 : echo "yourpasswd" |sudo -S yourcommand 
但是不安全,因为密码都显示在shell脚本里面了-_-

 

引自http://hi.baidu.com/mgqw/blog/item/2824bb01ccd5570a7aec2cd9.html

 

suspend

#!/bin/bash
echo "123" |sudo -S s2ram --force

 

hibernate

#!/bin/bash
echo "123" |sudo -S s2disk

 

 
posted on 2014-03-17 21:18  huashiyiqike  阅读(32723)  评论(0编辑  收藏  举报