Rob gives us this: On Solaris I'm using this instead. It already provides a program that REALLY jumps through hoops to get the hostname (checks NIS, DNS, local files, etc), so I'm going to use that instead. I use it in my script like this: /usr/lib/mail/sh/check-hostname | awk 'BEGIN { FS=" " } { if ($3 == "OK:") { print $7 } }' We should use this for any setup type code that needs the FQDN or hostname.
I should point out that this is in the package SUNWsndmu