sudo脚本怎么双击l.destop文件运行不了?
Tofloor
poster avatar
deepin-chinaren
deepin
2019-06-10 02:16
Author
#!/bin/bash

sudo apt-get autoclean;
sudo apt-get clean;
sudo apt-get autoremove;
sudo apt autoremove;
sudo apt-get update;
sudo apt-get upgrade;
sudo apt-get dist-upgrade;
sudo update-grub;
exit 0

以上是qlsj.sh脚本
[Desktop Entry]
Type=Application
Exec=sh /home/dfq/myshell/qlsj.sh
Icon=/media/dfq/下载专用/deepin文件/清理升级/qlsj.png
Hidden=false
NoDisplay=false
X-GNOME-Autostart-enabled=true
Name=清理及升级系统
以上是l.destop
所有文件位置最正确。
请大神看看,怎么双击l.destop文件运行不了?


Reply Favorite View the author
All Replies
avatar
superendermansm
deepin
2019-06-10 02:19
#1
#/bin/bash
Reply View the author
avatar
funtoo
deepin
2019-06-10 02:30
#2
sudo都没传递密码,能运行起来才怪
Reply View the author
avatar
deepin-chinaren
deepin
2019-06-10 02:41
#3
https://bbs.deepin.org/post/179048
sudo都没传递密码,能运行起来才怪

请指教,请给做个例子行吗?
Reply View the author
avatar
deepin-chinaren
deepin
2019-06-10 02:42
#4

#!/bin/bash是对的,我其他脚本都是可能运行的。
Reply View the author
avatar
ritter
deepin
2019-06-10 03:24
#5
add Terminal=true in desktop entry file.
Reply View the author
avatar
funtoo
deepin
2019-06-10 03:30
#6
https://bbs.deepin.org/post/179048
请指教,请给做个例子行吗?
  1. echo "password"|sudo -S foo
Copy the Code
如果要在终端窗口里面运行脚本,.desktop再加一行Terminal=true。
Reply View the author