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