shell获取当前目录,上级目录路径

当前目录

cur_dir=$(pwd)

上级目录

cur_dir=$(dirname $(pwd))
原文地址:https://www.cnblogs.com/jiqing9006/p/13083018.html