Improve portability of hostname
(#23)
This commit is contained in:
parent
0a5741df8f
commit
fd77d024dd
1 changed files with 2 additions and 1 deletions
3
yadm
3
yadm
|
@ -104,7 +104,8 @@ function alt() {
|
||||||
|
|
||||||
#; regex for matching "<file>##SYSTEM.HOSTNAME.USER"
|
#; regex for matching "<file>##SYSTEM.HOSTNAME.USER"
|
||||||
match_system=$(uname -s)
|
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_user=$(id -u -n)
|
||||||
match="^(.+)##($match_system|$match_system.$match_host|$match_system.$match_host.$match_user|())$"
|
match="^(.+)##($match_system|$match_system.$match_host|$match_system.$match_host.$match_user|())$"
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue