使用export可以将变量导入到shell中,示例如下:
先写export2;
#! /bin/sh
echo "$foo"
echo "$bar"再写export1:
#! /bin/sh
foo="the first "
export bar="the second"
./export2.sh
本文介绍如何使用export命令将变量导入到shell环境中,并通过示例展示其用法。
使用export可以将变量导入到shell中,示例如下:
先写export2;
#! /bin/sh
echo "$foo"
echo "$bar"#! /bin/sh
foo="the first "
export bar="the second"
./export2.sh

被折叠的 条评论
为什么被折叠?
