方法一:切换到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教程
以上就是centos怎么执行脚本的详细内容,更多请关注php中文网其它相关文章!
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号