Created
December 26, 2017 13:18
-
-
Save andreafioraldi/2102d2a8831d1ad423ed40526a28e8bd to your computer and use it in GitHub Desktop.
Get script directory in Bash script
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 | |
SCRIPTPATH="$( cd "$(dirname "$0")" ; pwd -P )" | |
echo "The script is in the directory $SCRIPTPATH" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment