Created
February 26, 2020 21:05
-
-
Save devarda/c32f851cce086e19bf4306a1ef82b135 to your computer and use it in GitHub Desktop.
Bash script shell script get script path of the file to solve relative path issue when you run the command
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
#!/bin/bash | |
SCRIPTPATH="$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )" | |
echo $SCRIPTPATH |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment