我如何通过双击在Linux上运行脚本

pnk*_*dhl 3 bash terminal ubuntu

我在文件上写了一个脚本(基本上是Ubuntu终端的命令)。是的,代码以

#!/bin/bash
Run Code Online (Sandbox Code Playgroud)

如何仅通过双击运行该脚本?可以使用终端运行它,但是我想通过桌面使其更易于访问。

我只是想模仿Windows上的* .bat文件。Windows上的* .bat文件包含一系列脚本,这些脚本可在命令提示符下运行,并且只需双击即可执行。

orv*_*rvi 5

跟着这些步骤:

  • 点击Alt+F2,键入dconf-editor并点击``Enter。

  • 在dconfg-editor goto中: org ? gnome ? nautilus ? preferences

  • 单击,executable-text-activation然后从下拉菜单中选择:

launch:将脚本作为程序启动。

要么

询问:通过对话框询问该怎么做。

关闭dconf-editor就可以了!

  • 通过执行此命令“sudo apt-get install dconf-tools”来安装“dconf-editor” (2认同)