获取shell脚本自身所在目录

DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
原文地址:https://www.cnblogs.com/sinferwu/p/13254139.html