Created
July 19, 2017 01:35
-
-
Save cesarmiquel/069136b683b674c94bd9f44437f3ec74 to your computer and use it in GitHub Desktop.
Determine the path of the running script in Bash.
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 | |
# | |
# Get path to this script: | |
# http://stackoverflow.com/questions/4774054/reliable-way-for-a-bash-script-to-get-the-full-path-to-itself | |
# | |
pushd `dirname $0` > /dev/null | |
SCRIPT_PATH=`pwd -P` | |
ROOTFS=`dirname "$SCRIPT_PATH"` | |
popd > /dev/null |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment