Created
March 30, 2023 12:42
-
-
Save oscarkramer/7670ee59a5fac0e72e4f281c318e8180 to your computer and use it in GitHub Desktop.
Bash get script directory
This file contains hidden or 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 | |
pushd $(dirname ${BASH_SOURCE[0]}) > /dev/null | |
SCRIPT_DIR=`pwd -P` | |
popd >/dev/null | |
echo "Script directory is $SCRIPT_DIR" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment