Linux设置环境变量PATH路径的两种方法
echo 'export dataPath=$HOME/data/pre' >> ~/.bash_profile
# 路径即刻生效:
# . .bash_profile 或 source .bash_profile 或 exec bash --login
echo 'export dataPath=$HOME/data/pre' >> ~/.bashrc
. .bashrc
- 环境变量去重
export PATH=$(printf "%s" "$PATH" | awk -v RS=':' '!a[$1]++ { if (NR > 1) printf RS; printf $1 }')
--- 她说, 她是仙,她不是神

浙公网安备 33010602011771号