Last active
August 29, 2015 14:06
-
-
Save xcv58/ceba2a4f4bb8729d2e58 to your computer and use it in GitHub Desktop.
Show Path of Shell Script File itself
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
SCRIPT_FILE=`which $0` | |
if [ -L $SCRIPT_FILE ]; then | |
SCRIPT_FILE=`readlink $SCRIPT_FILE` | |
fi | |
SCRIPT_PATH=`dirname $SCRIPT_FILE` | |
SCRIPT_FILE=`basename $SCRIPT_FILE` | |
echo Path: $SCRIPT_PATH | |
echo Filename: $SCRIPT_FILE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment