home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / os / linux / 10254 < prev    next >
Encoding:
Text File  |  1992-09-08  |  2.2 KB  |  54 lines

  1. Newsgroups: comp.os.linux
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!rpi!news.columbia.edu!cunixa.cc.columbia.edu!jml12
  3. From: jml12@cunixa.cc.columbia.edu (Jonathan M Lennox)
  4. Subject: Re: Binary locations
  5. Message-ID: <1992Sep9.051309.21561@news.columbia.edu>
  6. Sender: usenet@news.columbia.edu (The Network News)
  7. Nntp-Posting-Host: cunixa.cc.columbia.edu
  8. Reply-To: jml12@cunixa.cc.columbia.edu (Jonathan M Lennox)
  9. Organization: Columbia University
  10. References: <y#sn22#.genie@netcom.com>
  11. Date: Wed, 9 Sep 1992 05:13:09 GMT
  12. Lines: 40
  13.  
  14. In article <y#sn22#.genie@netcom.com> genie@netcom.com (The Genie) writes:
  15. >
  16. >Hi Linuxers.
  17. >
  18. >I've been using Linux for about 2 weeks now, and have found
  19. >a small nit-picky problem.  When I compile something
  20. >or move a executable binary into a directory, Linux refuses
  21. >to recognize the existence of the binary unless
  22. >1) I source my .cshrc which includes paths
  23. >2) The new binary must be located in the binary path.
  24. >
  25. >Is there a way for Linux to automatically recognize binaries
  26. >and execute them in any directory besides those listed
  27. >in the path + to recognize a new binary when placed in
  28. >a directory (in essence, I have to source the .cshrc to
  29. >tell Linux to check all the paths for all binaries).
  30.  
  31.   There are two issues here.
  32.  
  33.   First of all, your second point seems to imply that you do not have
  34. '.' (the current directory) in your path.  If you want the shell (this
  35. behavior is governed by your shell, not by Linux itself) to find files
  36. in your current directory, change your .login or .cshrc to reflect
  37. this as you set your path.
  38.  
  39.   Secondly, C-type shells maintain a hash table of command names, and
  40. do not re-search your path automatically when nothing is found.  This
  41. makes for faster error reporting in case of a typo, unlike sh-type
  42. shells, which will search your path in case new files have been added.
  43.  
  44.   The command "rehash" will update this table.  You should do this
  45. whenever you add executable files to anyplace along your path.  (I
  46. imagine "set path" also updates this, which is why resourcing your
  47. .cshrc solves your problem.)
  48.  
  49.   [This question really belongs on (or likely, would be answered by an
  50. FAQ on) one of the general comp.unix.* groups--it really doesn't
  51. belong on comp.os.linux.]
  52.  
  53. Jonathan Lennox
  54.