linux系统中如何区分自定义变量和系统环境变量


1、自定义变量:人为设置的变量

     系统环境变量:系统默认的变量

2、查看自定义变量 和 系统环境变量

[root@rhel7pc1 test]# echo $a

[root@rhel7pc1 test]# a=100                   ## 自定义变量
[root@rhel7pc1 test]# echo $a
100
[root@rhel7pc1 test]# echo $SHELL            ## 系统环境变量
/bin/bash

3、如何区分自定义变量换系统环境变量

[root@rhel7pc1 test]# echo $a
100
[root@rhel7pc1 test]# echo $SHELL
/bin/bash
[root@rhel7pc1 test]# printenv a            ## 说明a是自定义变量
[root@rhel7pc1 test]# printenv SHELL        ## 说明SHELL是系统环境变量
/bin/bash