1. 程式人生 > >sublime text中使用cmd+B執行shell的設定

sublime text中使用cmd+B執行shell的設定

sublime text中使用cmd+B執行shell的設定

https://blog.csdn.net/fengmm521/article/details/78446514

tools/build system/new build system,

新建的執行設定,複製下邊內容到這個檔案,並儲存:
{
“cmd”: [“sh”,”$file”],
“selector”: “source.shell”
}
檔名可以隨便起,我就叫:
shell.sublime-build

放在你的sublime text的設定preferences/browser包目錄/user下新建一個shell資料夾裡面放這個檔案(任意取名也可以);

然後編寫.sh檔案指令碼時,使用.sh字尾。
在檔案的第一行加上:

!bin/bash

像這樣:

這時就可以在sublime text環境下按cmd + B來直接執行shell指令碼了.