Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
与如何避免在 csh 中复制路径变量类似的问题。但我不使用 csh。
PATH=${SOMETHING}:${PATH}
如何从 PATH 中删除重复项。
我使用这个oneliner,但这取决于gawk。
PATH=$(echo $PATH|tr ":" "\n"|gawk '!($0 in a) { a[$0];print}'|paste -sd: - )