Removing need for dirname

cdist eliminates dirname with a simple replacement

${0%/*} == dirname "$0"