LINUX 点点滴滴
来源:百度文库 编辑:神马文学网 时间:2024/04/27 14:44:38
shell脚本中sudo 自动输入密码
在shell脚本中需要用root用的来执行指令: sudo 自动输入密码echo "password" | sudo -S netstat -tlnp
-S The -S (stdin) option causes sudo to read the password from the standard input instead of the terminal device.