Created
October 19, 2023 19:58
-
-
Save runmaxde/4b251f729d3338207d19a21f64ed8f48 to your computer and use it in GitHub Desktop.
Bash: Move to the script directory to be able to execute the script from anywhere
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
# ------------------------------------------------------------------------------------------------- | |
# -- Move to the script directory (to be able to execute the script from anywhere) | |
# ------------------------------------------------------------------------------------------------- | |
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" | |
cd "$SCRIPT_DIR" | |
# do your stuff |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment