[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: When a hashed pathname is deleted, search PATH
From: |
Chet Ramey |
Subject: |
Re: When a hashed pathname is deleted, search PATH |
Date: |
Sat, 15 Mar 2014 14:23:02 -0400 |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 |
On 3/14/14, 6:05 PM, Reuben Thomas wrote:
> On 14 March 2014 18:23, Chet Ramey <chet.ramey@case.edu
> <mailto:chet.ramey@case.edu>> wrote:
>
> On 3/14/14 12:11 PM, Reuben Thomas wrote:
> > Tested in bash 4.3.
> >
> > $ foo
> > ... a command is run
> > $ hash
> > hits command
> > 0 /home/rrt/bin/foo
> > $ rm `which foo`
> > $ which foo
> > /usr/bin/foo
> > $ foo
> > bash: /home/rrt/bin/foo: No such file or directory
> >
> > Why doesn't bash just remove the hashed path and do a normal PATH
> search? I
> > have to remove it manually.
>
> Look at the description of the `checkhash' option to `shopt'. It does
> what
> you want; it's just not the default.
>
>
> Thanks. Why is it not the default? Shouldn't an optimisation (hashing PATH
> lookup) be transparent to the user by default?
It's not been a problem, really. The existence of the `checkhash' option
has been enough. How often do you remove binaries in directories in $PATH?
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU chet@case.edu http://cnswww.cns.cwru.edu/~chet/
- When a hashed pathname is deleted, search PATH, Reuben Thomas, 2014/03/14
- Re: When a hashed pathname is deleted, search PATH, Chet Ramey, 2014/03/14
- Re: When a hashed pathname is deleted, search PATH, Reuben Thomas, 2014/03/14
- Re: When a hashed pathname is deleted, search PATH,
Chet Ramey <=
- Re: When a hashed pathname is deleted, search PATH, Reuben Thomas, 2014/03/15
- Re: When a hashed pathname is deleted, search PATH, Chet Ramey, 2014/03/17
- Re: When a hashed pathname is deleted, search PATH, Dave Rutherford, 2014/03/17
- Re: When a hashed pathname is deleted, search PATH, Chet Ramey, 2014/03/17
- Re: When a hashed pathname is deleted, search PATH, Reuben Thomas, 2014/03/17
- Re: When a hashed pathname is deleted, search PATH, Chet Ramey, 2014/03/17
- Re: When a hashed pathname is deleted, search PATH, Reuben Thomas, 2014/03/17
- Re: When a hashed pathname is deleted, search PATH, Linda Walsh, 2014/03/18
- Re: When a hashed pathname is deleted, search PATH, Reuben Thomas, 2014/03/18
- Re: When a hashed pathname is deleted, search PATH, Mike Frysinger, 2014/03/18