bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: bash hash bug


From: Bob Proulx
Subject: Re: bash hash bug
Date: Mon, 20 Nov 2006 19:00:08 -0700
User-agent: Mutt/1.5.9i

Linda Walsh wrote:
> Erp...  I probably thought it was getting rid of the problem I've had
> in the past with ksh-type shells of retaining a bad-mapping to a file that
> was no longer accessible.  A minor annoyance, admittedly, but one that
> entangled me a few times several (or more) years ago...

You probably were.  Because that is exactly why I have it set in my
environment too.  Otherwise if files are moved around bash fails to
find them in the new location.  So checkhash is just the behavior that
I want.  Of course I could just learn to use the csh-like 'hash -r'.  :-)

> Chet Ramey wrote:
> > When this option is on, bash has to check the hashed filename for
> > each hash lookup.  This essentially causes the hash entry to be
> > deleted and re-added each time, which resets the number of hits to 1.
> > (It could probably be done without the deletion and re-addition; I
> > should look at that.)

So there is the root of the current behavior.  I know that I had never
noticed that before because I never dumped out the hash tabled.  But
just because there is a deletion and addition I don't think this is a
performance issue.  (Is it?)  And so the count is purely cosmetic.

Did you have a purpose for the count other than just double checking
that the hash was working?

> > (This is not to say it could not behave better -- it can.  But
> > it's disabled by default.)

I read in the above that there is agreement with you that there could
be improvements there, but that the current behavior is it is at the
moment.

Bob




reply via email to

[Prev in Thread] Current Thread [Next in Thread]