Get the directory where a script resides and where it was called from
SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd -P)"
echo $SCRIPTDIR
CALLDIR="$(pwd -P)"
echo $CALLDIR
SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd -P)"
echo $SCRIPTDIR
CALLDIR="$(pwd -P)"
echo $CALLDIR