autoload -U compinit && compinit function print_known_hosts (){ if [ -f $HOME/.ssh/known_hosts ]; then cat $HOME/.ssh/known_hosts | tr ',' ' ' | cut -d' ' -f1 fi } _cache_hosts=($( print_known_hosts )) % ssh 192.168.1. 192.168.1.1 192.168.1.2 192.168.1.3 192.168.1.4