1 2 3 4 5 6 7 8 9 10 11 12 13 14
unset CDPATH MYDIR=$(pwd -P) FULLDIR=/tmp/bash-dir-a DIR=${FULLDIR##*/} mkdir $FULLDIR CDPATH=.:/tmp cd $DIR pwd echo $PWD cd "$MYDIR" rmdir $FULLDIR