欢迎来到尧图网

客户服务 关于我们

您的位置:首页 > 汽车 > 新车 > Centos怎么执行脚本

Centos怎么执行脚本

2024/10/25 10:34:38 来源:https://blog.csdn.net/qq_41941900/article/details/142592514  浏览:    关键词: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其它相关文章!

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com