Last active
June 30, 2017 19:24
-
-
Save linknum23/4894721e4e66021a442d2b6093c412bc to your computer and use it in GitHub Desktop.
Warn user to source bash script to keep environment variable changes
This file contains 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
#!/bin/bash | |
# idea from: https://stackoverflow.com/questions/2683279/how-to-detect-if-a-script-is-being-sourced | |
[[ "${BASH_SOURCE[0]}" != "${0}" ]] || echo -e "\e[31m""${BASH_SOURCE[0]} needs sourced to set the environment variables in this shell""\e[0m" | |
#set environment variables |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment