hostname is not specified by POSIX but uname -n is, so use the latter for
authordtucker <dtucker@openbsd.org>
Fri, 5 Feb 2021 06:01:58 +0000 (06:01 +0000)
committerdtucker <dtucker@openbsd.org>
Fri, 5 Feb 2021 06:01:58 +0000 (06:01 +0000)
portability.  Patch from Geert Hendrickx via github PR#208.

regress/usr.bin/ssh/percent.sh

index 54ab0e7..cf0084f 100644 (file)
@@ -1,12 +1,12 @@
-#      $OpenBSD: percent.sh,v 1.9 2020/07/17 07:10:24 dtucker Exp $
+#      $OpenBSD: percent.sh,v 1.10 2021/02/05 06:01:58 dtucker Exp $
 #      Placed in the Public Domain.
 
 tid="percent expansions"
 
 USER=`id -u -n`
 USERID=`id -u`
-HOST=`hostname | cut -f1 -d.`
-HOSTNAME=`hostname`
+HOST=`uname -n | cut -f1 -d.`
+HOSTNAME=`uname -n`
 
 # Localcommand is evaluated after connection because %T is not available
 # until then.  Because of this we use a different method of exercising it,