echo 123456 | sudo -S apt update
man sudo
-S, --stdin
Write the prompt to the standard error and read the password
from the standard input instead of using the terminal device.
将提示写入标准错误,从标准输入读取密码,而不是使用终端设备。
echo 123456 | sudo -S apt update
man sudo
-S, --stdin
Write the prompt to the standard error and read the password
from the standard input instead of using the terminal device.
将提示写入标准错误,从标准输入读取密码,而不是使用终端设备。