Last active
February 11, 2022 02:05
-
-
Save elibroftw/f2912c4bcb40ee737bfb415d2550b7b5 to your computer and use it in GitHub Desktop.
Linux Add Directories to ENV::PATH
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
# ... | |
# .env_path format: | |
# path1 | |
# path2 | |
if [ -f ~/.env_path ]; then | |
export PATH=$PATH:$(python3 -c "import os; print(':'.join((line.strip() for line in open('.env_path').readlines() if line.strip())))") | |
fi | |
# Python code: | |
# import os | |
# print(':'.join((line.strip() for line in open('.env_path').readlines() if line.strip()))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment