美文网首页
shell 里面的环境变量

shell 里面的环境变量

作者: shuff1e | 来源:发表于2018-07-10 16:23 被阅读8次
    [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 ~]$ 
    

    相关文章

      网友评论

          本文标题:shell 里面的环境变量

          本文链接:https://www.haomeiwen.com/subject/flqqpftx.html