[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Strange hostname completions after unset HOSTFILE
From: |
Freddy Vulto |
Subject: |
Strange hostname completions after unset HOSTFILE |
Date: |
Sun, 2 Aug 2009 13:57:21 +0200 |
Configuration Information:
Machine: i486
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='i486'
-DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i486-pc-linux-gnu'
-DCONF_VENDOR='pc' -DLOCALEDIR='/usr/share/locale' -DPACKAGE='bash'
-DSHELL -DHAVE_CONFIG_H -I. -I../bash -I../bash/include
-I../bash/lib -g -O2 -Wall
uname output: Linux rebase 2.6.28-14-generic #47-Ubuntu SMP Sat Jul
25 00:28:35 UTC 2009 i686 GNU/Linux
Machine Type: i486-pc-linux-gnu
Bash Version: 3.2
Patch Level: 48
Release Status: release
Description:
The manual says that upon unsetting HOSTFILE, the hostname list is cleared:
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.
but when I do so, instead of returning nothing, `compgen -A
hostname' returns strange data.
Repeat-By:
$ echo -n $HOSTFILE
$ cat -v /etc/hosts
127.0.0.1 localhost
127.0.1.1 freddy
$ compgen -A hostname
localhost
freddy
$ unset -v HOSTFILE
$ compgen -A hostname
���������
���������
$
I tested on another machine with bash-3.1 (patch level 17), having the
same problem.
Regards, Freddy Vulto
http://fvue.nl
- Strange hostname completions after unset HOSTFILE,
Freddy Vulto <=