Skip to content

Instantly share code, notes, and snippets.

@mjj2000
Last active May 8, 2023 15:04
Shell script to get full folder path of itself
if [ -L $0 ] ; then
BASEDIR=$(cd "$(dirname "$(readlink $0)")"; pwd -P) # for symbolic link
else
BASEDIR=$(cd "$(dirname "$0")"; pwd -P) # for normal file
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment