home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.unix.shell
- Path: sparky!uunet!panther!mothost!white!rtsg.mot.com!motcid!yorton
- From: yorton@turtle11.rtsg.mot.com (James J. Yorton)
- Subject: Korn's Response - ksh autoload quirk
- Message-ID: <1993Jan21.231531.8132@rtsg.mot.com>
- Sender: news@rtsg.mot.com
- Nntp-Posting-Host: turtle11
- Reply-To: yorton@rtsg.mot.com
- Organization: Motorola Inc., Cellular Infrastructure Group
- Date: Thu, 21 Jan 1993 23:15:31 GMT
- Lines: 49
-
- At one time, someone questioned the ksh autoload feature.
- I passed the question onto David Korn who responded.
- Below is a copy of the original post. Following it is Korn's
- response to me. Note that his response contains an explanation
- of how ksh-92 will handle this.
-
- In comp.unix.shell dattier@ddsw1.mcs.com wrote:
-
- > ksh 11/16/88d under Dell SVR4 4.0 here on ddsw1 and the ksh running
- > on a 3B2 on gagme recognize any filename in a directory in $FPATH as
- > an undefined function whether or not that name has been declared for
- > autoload with "autoload" or "typeset -fu."
- >
- > But there is a difference when a file in $FPATH has the same name as
- > an executable file in $PATH. If the undefined function has been
- > formally declared with "autoload" or "typeset -fu," then ksh
- > interprets an appearance of that name on the command line as a
- > reference to the function. If the undefined function has not been
- > declared but is recognized as such solely by dint of lying in
- > $FPATH, then an appearance of the name on the command line is taken
- > by ksh parser to mean the executable in $PATH (unless the function
- > has actually been loaded with the . command or by a call to another
- > function in the same file to whose name the file is linked).
- >
- > Is that the correct behavior? Is a file name in $FPATH that hasn't
- > been declared for autoload supposed to be recognizable at all as an
- > undefined function? I haven't seen anything about that (nor about a
- > difference in precedence from a declared undefined function) in the
- > ferkakte manual.
-
-
- David Korn writes:
-
- : The way ksh88 works, is that PATH is searched first and then FPATH.
- : The autoload feature allows functions bindings to occur before PATH.
- :
- : ksh92 uses a different strategy. While searching PATH, if a directory
- : is found that is also in FPATH, the the file is processed as a function.
- : This allows the user control over the order of function directories
- : and regular directories. In the case the PATH and FPATH contain
- : disjoint directories, the result is the same.
-
-
- --------------------------------------+---------------------------------------
- Jim Yorton | Telephone: +1 708-632-6695
- Motorola Inc., General Systems Sector |
- Cellular Infrastructure Group | internet: yorton@rtsg.mot.com
- Arlington Heights, IL 60004 | uucp: ...!uunet!motcid!yorton
- USA |
-