Use readlink rather than realpath; it's more commonly installed