On Wed, Mar 13, 2002 at 02:24:49 +0000, Brendan Halpin wrote:
> I've just installed a new gnuplot in the default location, and
> deleted the old copy I had in ~/bin.
>> But the new copy won't run:
>> [brendan at wivenhoe trends]$ which gnuplot
> /usr/local/bin/gnuplot
> [brendan at wivenhoe trends]$ alias gnuplot
> bash: alias: `gnuplot' not found
> [brendan at wivenhoe trends]$ file /usr/local/bin/gnuplot
> /usr/local/bin/gnuplot: ELF 32-bit LSB executable, Intel 80386, version 1, dynamically linked (uses shared libs), not stripped
> [brendan at wivenhoe trends]$ gnuplot
> bash: /home/brendan/bin/gnuplot: No such file or directory
>> What could be tying "gnuplot" typed at the command line to an
> invocation of the no-longer existing ~/bin/gnuplot, when "which"
> finds the correct one?
>> Now, to tell the truth, this has become an academic question,
> because starting a new shell sorts the problem. I'm still
> interested, though: what was "remembering" the old location?
Your shell was. man bash and read the part at the beginning about command
execution. ahe first time you typed "gnuplot" it searched your path and
ran it, it also cached "gnuplot" as a key to the real location that it found,
type hash under bash to list the contents of this command hash, and hash -r to
clear it out. I'm still a tcsh user for my sins, and its got a "rehash"
command you can read about in its man page, to rescan its search paths
and update its hash.
C.
--
Caolan McNamara | caolan at skynet.iehttp://www.skynet.ie/~caolan | +353 86 8161184
Airplanes are interesting toys but of no military value
Maintained by the ILUG website team. The aim of Linux.ie is to
support and help commercial and private users of Linux in Ireland. You can
display ILUG news in your own webpages, read backend
information to find out how. Networking services kindly provided by HEAnet, server kindly donated by
Dell. Linux is a trademark of Linus Torvalds,
used with permission. No penguins were harmed in the production or maintenance
of this highly praised website. Looking for the
Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!