Update run.sh: use `type' instead of `test' to check if a command exists