From 5678ce9e10867446e85e2d39ecbe6d7fb15f1a74 Mon Sep 17 00:00:00 2001 From: Uwe Werler Date: Sun, 28 Aug 2016 21:04:23 +0200 Subject: [PATCH] it makes no sense to call hostname -s several times --- SSH.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/SSH.sh b/SSH.sh index 4951323..888e6e7 100644 --- a/SSH.sh +++ b/SSH.sh @@ -112,12 +112,14 @@ _setwin(){ done $_tmux list-windows -F "#{window_id} #{pane_id} #{@HOST}" -t ${_sess} | { + + _localhost=$(hostname -s) while read _winid _paneid _val; do _host=${VALS[${_paneid##%}]} - [[ -z ${_host} ]] && _host=$(hostname -s) + [[ -z ${_host} ]] && _host=${_localhost} [[ ${_val} == ${_host} ]] || \ $_tmux setw -q -t ${_winid} "@HOST" "$(printf %-${_tabw}.${_tabw}s ${_host})"