導航:首頁 > 程序命令 > linuxshell腳本命令

linuxshell腳本命令

發布時間:2025-02-23 11:40:05

linux shell腳本執行命令

linux shell腳本執行命令主要有四種方式,具體介紹如下:
方式一:
切換到shell腳本所在的目錄(也叫工作目錄)執行shell腳本,具體代碼是:
cd /data/shell
./hello.sh
方式二:
可以以絕對路徑的方法去執行bash shell腳本,具體代碼是:
/data/shell/hello.sh
方式三:
可以選擇直接使用bash命令或者sh命令來執行bash shell腳本,具體代碼是:
cd /data/shell
bash hello.sh
或者
cd /data/shell
sh hello.sh
方式四:
還可以選擇在當前的shell環境中執行bash shell腳本,具體代碼是:
cd /data/shell
. hello.sh

cd /data/shell
source hello.sh
說明:前三種方式執行shell腳本時都需要在當前shell(即父shell)開啟的一個子shell環境中執行,完成之後就會關閉回到原來的shell中,但方式四是直接在當前的shell中執行的。

閱讀全文

與linuxshell腳本命令相關的資料

熱點內容
51單片機lcd顯示 瀏覽:582
hacmp命令 瀏覽:619
安卓游戲機都有什麼 瀏覽:72
androidapp被殺死 瀏覽:393
msp430單片機測量溫度 瀏覽:427
用友的雲加密是一直都不用換嗎 瀏覽:360
美的空調壓縮機壞了怎麼辦 瀏覽:803
usb單片機驅動 瀏覽:128
模板模式在源碼中的體 瀏覽:938
linuxsd卡分區 瀏覽:632
網頁查郵箱伺服器地址 瀏覽:226
程序員重構水管圖 瀏覽:43
電子加密貨幣有漏洞發行後能改嗎 瀏覽:796
java一段時間執行 瀏覽:513
pdftojpg綠色版 瀏覽:680
linux收音機 瀏覽:699
程序員眼中的井川里予 瀏覽:517
保研分數演算法 瀏覽:153
linux查看oracle密碼 瀏覽:317
android上傳超大文件 瀏覽:45