运行:
vim /etc/profile
添加如下代码:
awk -F: '{
sep = ""
for (i = 1; i <= NF; ++i)
if (unique[$i] != 1)
{
out = out sep $i
sep = ":"
unique[$i] = 1
}
print out
}' <<< $PATH
运行:
source /etc/profile