导出Shell脚本

时间:2017-01-26 11:07:23

标签: shell

我有一个名为a.sh的脚本,我从那里调用b.sh并将一些参数从a.sh传递给b.sh。 b.sh完成后,我从b.sh导出一些变量,我想从a.sh回显它。我在b.sh中使用export命令,但是我在做一个echo命令时它没有在a.sh中显示任何内容。

#b.sh
x=1
#some function is there
export $x

#a.sh
sh b.sh
echo "X value is : $x"
#output
# X value is :

0 个答案:

没有答案
相关问题