=First commit

This commit is contained in:
Lockszmith (kateryna) 2024-09-19 00:31:48 -04:00
parent 14020e28d4
commit 7ce0f968e8
27 changed files with 476 additions and 0 deletions

View file

@ -0,0 +1,12 @@
#!/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