Last active
May 25, 2020 19:42
-
-
Save robinbb/856607e1f436cd5c5d4f804abfa8e663 to your computer and use it in GitHub Desktop.
Get directory of Bash script
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
#! /usr/bin/env bash | |
MY_DIR="$(CDPATH='' cd -- "$(dirname "${BASH_SOURCE[0]}")" 2>/dev/null && pwd)" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment