[root@shuffle-dev ~]$ res="success"
[root@shuffle-dev ~]$ export | grep res
[root@shuffle-dev ~]$ export res
[root@shuffle-dev ~]$ export | grep res
declare -x res="success"
[root@shuffle-dev ~]$ res="failed"
[root@shuffle-dev ~]$ export | grep res
declare -x res="failed"
[root@shuffle-dev ~]$ var="hello"
[root@shuffle-dev ~]$ cat test.sh
#!/bin/bash
echo $res
echo $var
[root@shuffle-dev ~]$ bash test.sh
failed
[root@shuffle-dev ~]$
网友评论