shouldn't this be `/bin/sh` to guarantee that we get the right shell?  `type` should be portable as long as we have an `sh` and not a `csh`