type -p is not supported by debian sh, therefore replaced by which