shell获取当前脚本执行绝对路径

base_dir=$(cd "$(dirname "$0")";pwd) 

编程技巧