Linux下sh文件运行及桌面环境双击运行sh文件

Linux下sh文件运行及桌面环境双击运行sh文件

sh文件运行:

1、修改为可执行权限:

chmod u+x hello.sh

2、运行

./hello.sh

3、不使用可执行权限修改,用sh直接运行

sh ./hello.sh

桌面环境双击运行sh文件:

Mac:

1、修改后缀sh变成command:hello.sh->hello.command

2、修改可执行权限:chmod u+x hello.command

Ubuntu:

1、修改可执行权限:chmod u+x hello.sh

2、任意打开一个文件夹,选择左上角的【编辑】->【首选项】

选择【打开可执行文本文件时运行它们】即可实现双击运行。

参考:

http://blog.csdn.net/lipeiran1987/article/details/18406535

http://www.cnblogs.com/jackchiang/p/4676984.html

相关

索尼大法好,索尼粉为你详细解读索尼 Xperia Z5 Premium的8大黑科技
如何成为用友软件开发者
365比分下载

如何成为用友软件开发者

📅 06-28 👁️ 558
苹果6的电池能用多长时间?
365比分下载

苹果6的电池能用多长时间?

📅 06-28 👁️ 3802