可以 : 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

 

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-01-20
  • 2021-12-23
  • 2022-01-15
  • 2021-09-24
  • 2021-12-04
猜你喜欢
  • 2022-12-23
  • 2021-10-16
  • 2021-06-24
  • 2022-12-23
  • 2022-12-23
  • 2021-06-21
  • 2022-12-23
相关资源
相似解决方案