diff --git a/bash_completion b/bash_completion index c82ad80c9ea..e587bdce044 100644 --- a/bash_completion +++ b/bash_completion @@ -1685,9 +1685,11 @@ _known_hosts_real() fi # Add hosts reported by ruptime. - COMPREPLY+=( $(compgen -W \ - "$(ruptime 2>/dev/null | awk '!/^ruptime:/ { print $1 }')" \ - -- "$cur") ) + if type ruptime &>/dev/null; then + COMPREPLY+=( $(compgen -W \ + "$(ruptime 2>/dev/null | awk '!/^ruptime:/ { print $1 }')" \ + -- "$cur") ) + fi # Add results of normal hostname completion, unless # `COMP_KNOWN_HOSTS_WITH_HOSTFILE' is set to an empty value.