2 ms·
OMG one of the classic Linux/Solaris footguns! On Linux, hostname queries the host’s name; on Solaris, hostname sets the host’s name. If (say) you have a favour
by fanf2 2y ago
OMG one of the classic Linux/Solaris footguns! On Linux, hostname queries the host’s name; on Solaris, hostname sets the host’s name. If (say) you have a favourite shell prompt that includes the hostname, and your PS1 line is old enough to predate bash’s \h escape and/or is designed to work with other shells, it might contain `hostname -s`. Carelessly copy your shell prompt to a Solaris box, and fun ensues when it changes its name to -s ! Hopefully you are suspicious enough to notice your prompt has gone weird and discover the problem before breaking a telephone service.