Improve uniq_path function

This commit is contained in:
2023-09-27 18:44:58 +02:00
parent f31c44630e
commit cd27b2464a

View File

@@ -78,7 +78,7 @@ function remove_path() {
}
function uniq_path() {
echo "$PATH" | tr ":" "\n" | awk '!seen[$0]++' | tr "\n" ":" | sed -r 's/:+/:/g' | sed -r 's/^:|:$//g'
path | awk '!seen[$0]++' | tr "\n" ":" | sed -r 's/:+/:/g' | sed -r 's/^:|:$//g'
}
function set_uniq_path() {