[Problem feedback] inux运行shell脚本sudo自动输入密码,按任意键会退出终端
Tofloor
poster avatar
johnmy
deepin
2025-11-11 07:58
Author

按这个来进行的:

https://blog.csdn.net/Britripe/article/details/114081200

脚本内容:

#!/bin/bash
echo yourpassword | sudo -S apt-get update

双击脚本,点击在终端运行,显示终端,提示输入密码,但这时按任意键,终端会退出。

是怎么回事?

Reply Favorite View the author
All Replies
jjcui8595
deepin
Resources Team
2025-11-11 09:04
#1

" yourpassword" 需要改成你真实的密码,而不是照抄字符

Reply View the author
johnmy
deepin
2025-11-11 18:20
#2

ok 多谢,多谢

Reply View the author