shell include script

两个文件:
# 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

你可能感兴趣的:(shell,shell,shell)