home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / unix / aux / 3037 < prev    next >
Encoding:
Text File  |  1992-07-31  |  1.6 KB  |  49 lines

  1. Newsgroups: comp.unix.aux
  2. Path: sparky!uunet!sun-barr!ames!nsisrv!jagubox!jim
  3. From: jim@jagubox.gsfc.nasa.gov (Jim Jagielski)
  4. Subject: Re: ksh weirdness
  5. Message-ID: <924@jagubox.gsfc.nasa.gov>
  6. Sender: usenet@nsisrv.gsfc.nasa.gov (Usenet)
  7. Nntp-Posting-Host: jagubox.gsfc.nasa.gov
  8. Reply-To: jim@jagubox.gsfc.nasa.gov (Jim Jagielski)
  9. Organization: NASA/Goddard Space Flight Center
  10. References: <5285@transfer.stratus.com>
  11. Date: Fri, 31 Jul 1992 10:18:35 GMT
  12. Lines: 35
  13.  
  14. dswartz@redondo.sw.stratus.com (Dan Swartzendruber) writes:
  15.  
  16.  
  17. >I just finished tracking down a weird "feature" in ksh.  Basically, if
  18. >you cd to a directory with one or more symlinks as components, the pwd
  19. >command in ksh reports the current directory based on what you typed,
  20. >not where you actually are.  Example:
  21.  
  22. >in /usr, local is a symlink to /users/local
  23.  
  24. >so when I type "cd /usr/local/src", followed by "pwd", I get told
  25. >/usr/local/src, not /users/local/src.  Note that csh and sh do the
  26. >expected thing (well, expected by me anyway.)
  27.  
  28. This is due to the way 'pwd' is implemented... it's actually "print -r - $PWD"
  29.  
  30. For fun try:
  31.  
  32.     $ cd /usr/local/src
  33.     $ cd ..
  34.     $ cd ..
  35.  
  36. You get /usr not /users.
  37.  
  38. Some people, myself included, would suggest that "ksh" is the more correct
  39. of "sh" and "csh" ;)
  40. -- 
  41. ==============================================================================
  42. #include <std/disclaimer.h>
  43.  
  44.                 Jim Jagielski                  NASA/GSFC, Code 734.4
  45.           jim@jagubox.gsfc.nasa.gov             Greenbelt, MD 20771
  46.  
  47.            "The great scallop... this tatty, scrofulous old rapist,
  48.                is second in depravity only to the common clam."
  49.