prepare for symclone.
From now on, _src.posix will be the single source of truth. And _home(.*) will symlink into it.
This commit is contained in:
parent
5e26df3f9b
commit
44b03e8724
47 changed files with 58 additions and 0 deletions
15
_src.posix/private_dot_config/sz.env/PATH_zz_cleanup.env
Normal file
15
_src.posix/private_dot_config/sz.env/PATH_zz_cleanup.env
Normal file
|
@ -0,0 +1,15 @@
|
|||
#!/usr/bin/env -S sh -c 'echo "Not a user script. source(aka .) only"'
|
||||
|
||||
# Remove duplicates from PATH
|
||||
OLDPATH="$PATH"; NEWPATH=""; colon=""
|
||||
while [ "${OLDPATH#*:}" != "$OLDPATH" ]; do
|
||||
entry="${OLDPATH%%:*}"; search=":${OLDPATH#*:}:"
|
||||
[ "${search#*:"$entry":}" = "$search" ] && [[ -d $entry ]] && NEWPATH="$NEWPATH$colon$entry" && colon=:
|
||||
OLDPATH="${OLDPATH#*:}"
|
||||
done
|
||||
NEWPATH="$NEWPATH:$OLDPATH"
|
||||
export PATH="$NEWPATH"
|
||||
unset NEWPATH OLDPATH colon entry search
|
||||
|
||||
[[ -n "${DBG}" ]] && echo "${PATH//:/\n}"
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue