16 lines
274 B
Bash
Executable file
16 lines
274 B
Bash
Executable file
#!/usr/bin/env bash
|
|
#
|
|
# SPDX-License-Identifier: MIT
|
|
|
|
# handy function to cleanly remove a PATH element
|
|
function pathdel() {
|
|
local _PDEL=$1
|
|
PATH=:$PATH:
|
|
PATH=${PATH//:$_PDEL:/:}
|
|
PATH=${PATH#:};
|
|
PATH=${PATH%:}
|
|
export PATH
|
|
}
|
|
|
|
pathdel /some/random/bin
|
|
echo "$PATH"
|