shell 得到当前目录路径

cd "$(dirname $0)"
project=$(pwd | cut -d / -f 4)
echo 'project: '$project
cd /home/loginuser/$project/app