basepath=$(cd `dirname $0`; pwd)
源文 : https://sexywp.com/bash-how-to-get-the-basepath-of-current-running-script.htm