1. 执行脚本的办法
sh/bash scripts.sh
chown +x ./scripts.sh && ./scripts.sh
source scripts.sh
. (空格) scripts.sh
cat oldboyedu.sh |bash # 效率较低
source 与 . (点) 的作用
source命令
[root@oldboy ~]# help source |head -2source: source 文件名 [参数]
在当前 shell 中执行一个文件中的命令。
. (点)
[root@oldboy scripts]# help . |head -2.: . 文件名 [参数]
在当前 shell 中执行一个文件中的命令。
2. sh 于 source的区别