mydir=$(cd "$(dirname "${BASH_SOURCE[0]}")"; pwd) #mydir=$(cd "$(dirname "$0")"; pwd) echo "dir: $mydir"