方法一:切換到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
推薦教程:centos教程
? 版權聲明
文章版權歸作者所有,未經允許請勿轉載。
THE END
喜歡就支持一下吧
相關推薦