(三)SHELL变量之环境变量

  • 定义环境变量:

    方法一:export 变量名=变量值
    方法二:export 自定义变量名
  • 引用变量:$变量名 ${变量名}
  • 查看环境变量:echo $变量名 或 export
  • 取消环境变量:unset 变量名
  • 变量作用范围:在当前shell和子shell中有效

猜你喜欢

转载自www.cnblogs.com/lovelinux199075/p/8874310.html