Wouldn't
readlink -f $0
work to get the actual location of the script, and from there get the base for relative scripts? readlink -f $0
work to get the actual location of the script, and from there get the base for relative scripts?