From cd27b2464a577b35e6191efb2874dbddf968b7a0 Mon Sep 17 00:00:00 2001 From: Martin Blazik Date: Wed, 27 Sep 2023 18:44:58 +0200 Subject: [PATCH] Improve uniq_path function --- functions.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/functions.sh b/functions.sh index fd2844b..14e4071 100644 --- a/functions.sh +++ b/functions.sh @@ -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() {