use a bash implementation of realpath if it is not installed.