Skip to content

Instantly share code, notes, and snippets.

@dblalock
Created July 9, 2014 22:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dblalock/5487534456ce1a35cf65 to your computer and use it in GitHub Desktop.
Save dblalock/5487534456ce1a35cf65 to your computer and use it in GitHub Desktop.
Bash include another file
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source "${DIR}/myFileToInclude.sh"
source "${DIR}/myOtherFileToInclude.sh"
# see http://stackoverflow.com/questions/59895/can-a-bash-script-tell-what-directory-its-stored-in
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment