Created
December 6, 2023 14:14
-
-
Save oowekyala/36719cbe8a7c2362ca681230895efd71 to your computer and use it in GitHub Desktop.
PATH manipulation functions for your shell
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
prepend_PATH() { | |
export PATH="$1:$PATH" | |
} | |
append_PATH() { | |
export PATH="$PATH:$1" | |
} | |
# Delete some part of the path | |
# https://unix.stackexchange.com/questions/108873/removing-a-directory-from-path | |
delete_from_PATH() { | |
local search="$1" | |
export PATH=`echo $PATH | tr ":" "\n" | grep -v "$search" | tr "\n" ":"` | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment