.
3ss.cn

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
赞(0)
未经允许不得转载:互联学术 » centos怎么样执行足本

评论 抢沙发