function hosts {set -A reply $($HOME/bin/gethosts)} compctl -K hosts -x 'c[-1,-l]' -u -- ping ssh telnet traceroute #### #!/usr/bin/perl -w use strict; my $HOME= $ENV{HOME}; open (HOSTS, "$HOME/.ssh/known_hosts") or exit; my @hosts = ; close HOSTS; foreach my $line (@hosts) { chomp($line); my ($name) = split /\s+/, $line, 2; my @names = split /,/, $name; foreach (@names) { print "$_ "; } }