19 lines
465 B
Bash
19 lines
465 B
Bash
get_clean_path() {
|
|
sed 's/ *:\?$//g;s/`/``/g;s/:/`:`/g;s/\\`:`/\\:/g;' <<< $1 | \
|
|
awk -v RS='`:`' -v ORS='`:`' '!arr[$0]++' | \
|
|
sed 's/`:`/:/g;s/:$//g'
|
|
}
|
|
|
|
# set PATH so it includes user's private bin if it exists
|
|
if [[ -d "$HOME/bin" ]] ; then
|
|
export PATH="$HOME/bin:$PATH"
|
|
fi
|
|
|
|
# set PATH so it includes user's private bin if it exists
|
|
if [[ -d "$HOME/.local/bin" ]] ; then
|
|
export PATH="$HOME/.local/bin:$PATH"
|
|
fi
|
|
|
|
PATH=$( get_clean_path $PATH )
|
|
|