[openssh-commits] [openssh] 02/02: upstream: hostname is not specified by POSIX but uname -n is, so use

Bob Proulx bob at proulx.com
Mon Feb 8 09:43:24 AEDT 2021


Tim Rice wrote:
> > -HOST=`hostname | cut -f1 -d.`
> > -HOSTNAME=`hostname`
> > +HOST=`uname -n | cut -f1 -d.`
> > +HOSTNAME=`uname -n`
> 
> This may not work as intended.
> ....
> tim at server01-UnixWare 69% hostname
> server01.int.multitalents.net
> tim at server01-UnixWare 70% uname -n
> server01
> ....

I'll just note that on Debian, Ubuntu, other derivatives (such as
Mint, Trisquel...) both the "uname -n" and "hostname" values would
typically be just the short name.  It's not just UnixWare...

    rwp at havoc:~$ uname -n
    havoc

    rwp at havoc:~$ hostname
    havoc

Getting a FQDN is truly not trivial. :-(

Bob


More information about the openssh-unix-dev mailing list