Aadd LWS to PATH

remove duplicates from PATH
This commit is contained in:
Martin Blazik
2022-01-18 07:39:34 +01:00
parent b39fee5953
commit 924718fe27
2 changed files with 6 additions and 4 deletions

6
bashrc
View File

@@ -10,6 +10,6 @@ for rc_file in $WORKSPACE/rc/*; do
source $rc_file source $rc_file
done done
#export PATH=$($WORKSPACE/bin/path-uniq.py $WORKSPACE/bin $WORKSPACE/opt/bin) PATH="$PATH:$LWS/bin"
export PATH=$(echo "$PATH" | tr ":" "\n" | awk '!seen[$0]++' | tr "\n" ":") PATH="$(uniq_path)"
export PATH

View File

@@ -31,4 +31,6 @@ function prepend_path() {
fi fi
} }
function uniq_path() {
echo "$PATH" | tr ":" "\n" | awk '!seen[$0]++' | tr "\n" ":" | sed -r 's/:+/:/g' | sed -r 's/^:|:$//g'
}