Comment 0 for bug 184175

Revision history for this message
ojb (olejorgenb) wrote :

From bash manual:
       HOSTFILE
              Contains the name of a file in the same format as /etc/hosts
              that should be read when the shell needs to complete a hostname.
              The list of possible hostname completions may be changed while
              the shell is running; the next time hostname completion is
              attempted after the value is changed, bash adds the contents of
              the new file to the existing list. If HOSTFILE is set, but has
              no value, bash attempts to read /etc/hosts to obtain the list of
              possible hostname completions. When HOSTFILE is unset, the
              hostname list is cleared.

When HOSTFILE is specified and ~/.ssh/known_hosts exits the entries in $HOSTFILE is not used for completion.

The problem is '_known_hosts()' in /etc/bash_completion where it seems only entries from "known host files" are used. I'm not sure if this is intentional, but if it is I'd like to file a complaint :-) If not I guess I'm in the right place.

I suggest that the result from know_hosts and $HOSTFILE should be merged.

Running Feisty, GNU bash, version 3.2.13(1)-release (i486-pc-linux-gnu)