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


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM