Menu Home

Shell script to get full path of itself

SCRIPTPATH="$( cd "$(dirname "$0")" ; pwd -P )"
pushd `dirname $0` > /dev/null
SELFPATH=`pwd -P`
popd > /dev/null
echo $SELFPATH

Categories: shell

Tagged as:

lnmcc

Leave a Reply

Your email address will not be published.