script-functions: replace type -p with which