运维网's Archiver
论坛
›
Shell/Powershell
› shell执行三种方法
bestjoe
发表于 2018-8-28 07:47:42
shell执行三种方法
1,sh t.s 或者 shell t.s
2,/server/scripts/t.sh 或者 ./t.sh #注:要有执行权限
3,source t.sh 或者.t.sh #可以将当前脚本中变量 函数 带到shell中# 注:不需要有执行权限
常用于系统脚本调用
例:
# cat who.sh
user=`whoami`
# source who.sh && echo $user
root
页:
[1]
查看完整版本:
shell执行三种方法