home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / unix / shell / 5456 < prev    next >
Encoding:
Text File  |  1993-01-21  |  2.8 KB  |  62 lines

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