X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=core%2F30_hostname%2F30_hostname.zprofile;h=5b2dbd3faa15899af1295095b6f2cfd451f0bdf1;hb=d7c38658ad0e6ae03a6ca63c7cb80c44092ff357;hp=a976ecd1bd95db059f68406788e1a6775cdc8800;hpb=1a67062339925a470db1b61e3366b79de3368775;p=ax-zsh.git diff --git a/core/30_hostname/30_hostname.zprofile b/core/30_hostname/30_hostname.zprofile index a976ecd..5b2dbd3 100644 --- a/core/30_hostname/30_hostname.zprofile +++ b/core/30_hostname/30_hostname.zprofile @@ -10,6 +10,7 @@ if (( $+commands[scutil] )); then SHORT_HOST=$(scutil --get ComputerName 2>/dev/null) elif (( $+commands[hostnamectl] )); then SHORT_HOST=$(hostnamectl --pretty 2>/dev/null) + [[ "$SHORT_HOST" =~ : ]] && unset SHORT_HOST fi [[ -z "$SHORT_HOST" ]] && SHORT_HOST=${HOST/.*/} export SHORT_HOST