Skip to content

Instantly share code, notes, and snippets.

@elibroftw
Last active February 11, 2022 02:05
Show Gist options
  • Save elibroftw/f2912c4bcb40ee737bfb415d2550b7b5 to your computer and use it in GitHub Desktop.
Save elibroftw/f2912c4bcb40ee737bfb415d2550b7b5 to your computer and use it in GitHub Desktop.
Linux Add Directories to ENV::PATH
# ...
# .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