Article View: gnu.bash.bug
Article #267Re: bash and FPATH
From: Noah Friedman
Date: Sat, 08 Aug 1992 23:30
Date: Sat, 08 Aug 1992 23:30
19 lines
1515 bytes
1515 bytes
In article <9208061446.AA24943.SM@odin.INS.CWRU.Edu> chet@odin.ins.cwru.edu (Chet Ramey) writes: >There's a shell script implementation of `autoload' (which is what ksh >uses FPATH for) as part of the bash-1.12 distribution in >.../examples/functions/autoload. I wrote this one, based on something >from Bill Trost. > >Noah Friedman also has something similar, with require/provide. He's >posted it several times. My version is also, IMHO, more correct in that it does the "lazy" evaluation your implementation lacks. The point of autoload is to be relatively inexpensive until you actually try to run the command. Your version is always expensive because it looks for the source file when you call autoload. I also have a version of "load" and a require/provide set of functions which use FPATH. In fact, "load" is just a "source" that uses FPATH instead of PATH, the way "source" should have been implemented in the first place (though this isn't bash's fault. Blame it on the standards).
Technical Details
Message-ID:
<FRIEDMAN.92Aug8193038@nutrimat.gnu.ai.mit.edu>Path:
arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!gnu.ai.mit.edu!friedmanReferences:
<9208061446.AA24943.SM@odin.INS.CWRU.Edu>Show Full Headers
Complete Article Headers
Newsgroups: gnu.bash.bug Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!gnu.ai.mit.edu!friedman From: friedman@gnu.ai.mit.edu (Noah Friedman) Subject: Re: bash and FPATH Message-ID: <FRIEDMAN.92Aug8193038@nutrimat.gnu.ai.mit.edu> Sender: gnulists@ai.mit.edu Organization: Free Software Foundation, 675 Mass Ave. Cambridge, MA 02139 References: <9208061446.AA24943.SM@odin.INS.CWRU.Edu> Distribution: gnu Date: Sat, 8 Aug 1992 23:30:38 GMT Approved: bug-bash@prep.ai.mit.edu Lines: 21