shell include script

来源:互联网 发布:cad2016for mac汉化包 编辑:程序博客网 时间:2024/05/16 17:38

两个文件:
# cat a.sh
echo "===========hello========="
name='a.sh'


# cat b.sh
. ./a.sh //include方式: . 路径/脚本名
echo "name is $name"
执行b.sh //shell include 会执行include脚本的每一行


# sh b.sh
===========hello=========
name is a.sh

原创粉丝点击