NetBSD's /bin/sh no longer accepts "type -p". The same is true for some other OSes (e.g. recent DragonFly BSD). Use "command -v" instead.