简介
之前写mapreduce用的是go1.9,最近写GFS要用go1.16,出了很多毛病
环境变量
环境变量分为用户环境变量和全局环境变量,首先要知道基本概念:
https://blog.csdn.net/Zou__Sheng/article/details/100146197
简单概括就是:
etc/profile
全局环境设置,登录时会读取
~/.profile
(debian)或~/.bash_profile
用户环境设置,相应用户登录时会读取
/etc/bashrc
为每一个运行bash shell的用户执行此文件.当bash shell被打开时读取.
~/.bashrc
相应用户bash shell被打开时读取
此外还有~/.bash_logout
等,在bash退出后被执行
注意: ssh 上non-root用户算该用户登录,但是sudo su切换到root并不算root用户登录,此时只会执行root用户的~/.bash_profile
所以要想设置永久环境变量,可以在相应文件加上
export