BZ 1088032 - use "command" not "type" since "command" is POSIX compliant and is available on Solaris as well as other UNIX flavors. Don't use readlink unless we know it is available, to avoid spitting out those error messages.
Tested on Solaris 10 ("uname -sr" returns "SunOS 5.10") and readlink does not exist, but "command -v" works so this fix should work on Solaris 10.
(cherry picked from commit 7a143a8f6b5f95bd8fe4be8c205c294b6cdc4774)