Similar question to How to keep from duplicating path variable in csh. But I don't use csh.
PATH=${SOMETHING}:${PATH}
How do I remove duplicates from PATH.
Similar question to How to keep from duplicating path variable in csh. But I don't use csh.
PATH=${SOMETHING}:${PATH}
How do I remove duplicates from PATH.
I use this oneliner, but it depends on gawk.
PATH=$(echo $PATH|tr ":" "\n"|gawk '!($0 in a) { a[$0];print}'|paste -sd: - )