Centos怎么执行脚本
方法一:切换到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环境中执行bash shell脚本
bash /data/shell/hello.sh
或
sh /data/shell/hello.sh
推荐教程:centos/" target="_blank">centos教程
以上就是centos怎么执行脚本的详细内容,更多请关注CSDN其它相关文章!
原文地址:https://blog.csdn.net/qq_41941900/article/details/142592514
免责声明:本站文章内容转载自网络资源,如本站内容侵犯了原著者的合法权益,可联系本站删除。更多内容请关注自学内容网(zxcms.com)!