From fd77d024dd595dfd14b255c763b2a2fc255d8b6a Mon Sep 17 00:00:00 2001 From: Tim Byrne Date: Fri, 9 Sep 2016 16:32:35 -0500 Subject: [PATCH] Improve portability of `hostname` (#23) --- yadm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/yadm b/yadm index 8914183..6607de4 100755 --- a/yadm +++ b/yadm @@ -104,7 +104,8 @@ function alt() { #; regex for matching "##SYSTEM.HOSTNAME.USER" match_system=$(uname -s) - match_host=$(hostname -s) + match_host=$(hostname) + match_host=${match_host%%.*} #; trim any domain from hostname match_user=$(id -u -n) match="^(.+)##($match_system|$match_system.$match_host|$match_system.$match_host.$match_user|())$"