On Tue, 2010-10-19 at 08:18 +0200, H.Merijn Brand wrote:
> On Tue, 19 Oct 2010 10:02:38 +1100, Daniel Pittman
> <[email protected]> wrote:
> > What I find hateful is the "Don't Be Stupid" switch. Which, naturally, the
> > developers of bash supplied because you wouldn't want to surprise people by
> > changing this monumentally stupid ^W historic behaviour.
> >
> > So, instead, we have 'set -o checkhash' to ask it to please work like sane
> > people expect.
> >
>
> Well, bash is not the only shell that does this stupidity. The most
> recent update of tcsh (6.17.02) added a flag - also default off - to
> rehash automatically
> autorehash (+)
> If set, the internal hash table of the contents of the directo-
> ries in the path variable will be recomputed if a command is
> not found in the hash table. In addition, the list of avail-
> able commands will be rebuilt for each command completion or
> spelling correction attempt if set to `complete' or `correct'
> respectively; if set to `always', this will be done for both
> cases.
ZSH seems to be winning the stupidity war on this one for a change.
Oh! for a checkhash or autorehash option. We've got:
HASH_CMDS <D>
Note the location of each command the first time it is executed.
Subsequent invocations of the same command will use the saved
location, avoiding a path search. If this option is unset, no
path hashing is done at all. However, when CORRECT is set,
commands whose names do not appear in the functions or aliases
hash tables are hashed in order to avoid reporting them as
spelling errors.
CORRECT (-0)
Try to correct the spelling of commands. Note that, when the
HASH_LIST_ALL option is not set or when some directories in the
path are not readable, this may falsely report spelling errors the
first time some commands are used.
HASH_LIST_ALL <D>
Whenever a command completion is attempted, make sure the entire
command path is hashed first. This makes the first completion
slower.
So you can switch command hashing off except if you use completion it
will still hash it but is prone to lying at you the first time you use a
command?
I'd hate to see the code that causes that much brain damage. I wonder if
there's anyone amongst the 6.876 billion people on the planet that
actually wanted it to work like this?
For me I just type rehash when I need to and pretend to myself I'm back
in the 1970s using a tape-based filesystem.
Cheers,
Martin