Bojan Land wrote:
If I just use 'type mycmd' the result is similar in that it simply
prepends the query before the result with " is " inbetween; -p prevents
this additional processing and output?
No. According to 'help type', "If the -p flag is used, `type' either
returns the name of the disk
Bojan Land wrote:
> Bob Proulx wrote:
> > This is possible when it has been cached by bash and then the
> > executable is either moved from its original location or a new
> > executable appears earlier in PATH.
>
> I did not move the executable.
Right. "or a new executable appears earlier in PAT
On Wed, 2007-01-03 at 22:55 -0700, Bob Proulx wrote:
> > I have learned a lot from your reply, and yes some of what you wrote
> > explains this as not being a bug; after a reboot I cannot reproduce
> > these results.
>
> You should not need to reboot to clear a single shell process hash
> cache.
Bob Proulx wrote:
Matthew Woehlke wrote:
$ which --version
GNU which v2.16, Copyright (C) 1999 - 2003 Carlo Wood.
Wonderful. Yet another 'which' implementation!
But a consistent (when available) one. :-) I like GNU programs because
they are usually portable; for example I have built GNU 'w
Matthew Woehlke wrote:
> Bob Proulx wrote:
> > Traditional Unix machines used a csh script /usr/bin/which to search a
> > defined set of system paths. Newer ksh used 'whence'. Bash uses 'type'.
> > XSI extensions to POSIX require 'command -v'. Debian implemented
> > 'which' as a bash shell scrip
Bob Proulx wrote:
Bojan Land wrote:
Do you know which shells do not have type and thus rely on which?
I wouldn't guess that *any* shell "relies" on 'which'... probably all
shells have built-in $PATH lookup, but may not expose it to the user in
the way bash's 'type' does.
As far as I know
Bojan Land wrote:
Under what circumstances does the gnu-bash path hash differ from that of
the $PATH variable? Why is it even possible for this difference to
occur?
Because bash uses a hash to speed look-up of frequently used commands.
The only way to (almost) always get the right command eve