home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / unix / question / 15835 < prev    next >
Encoding:
Text File  |  1993-01-22  |  1.1 KB  |  37 lines

  1. Newsgroups: comp.unix.questions
  2. Path: sparky!uunet!pipex!mfmail!dnh
  3. From: dnh@mfltd.co.uk (Des Herriott)
  4. Subject: Re: ksh prompt
  5. Message-ID: <1993Jan22.120028.18986@mfltd.co.uk>
  6. Sender: dnh@mfltd.co.uk (Des Herriott)
  7. Organization: Micro Focus Ltd., Newbury, UK
  8. References:  <C17DJ4.FoA@sdf.lonestar.org>
  9. Date: Fri, 22 Jan 1993 12:00:28 GMT
  10. Lines: 25
  11.  
  12.  
  13. In article <C17DJ4.FoA@sdf.lonestar.org>, larry@sdf.lonestar.org (Larry D. Clark) writes:
  14. >     I am using ksh on a platform running Unix 5.4 at work and would 
  15. >     like to have my PS1 to reflect the current working directory.
  16. >     Does any one have any ideas how to do it??
  17.  
  18. Probably the best way of doing it is to write a function:
  19.  
  20.   function _cd 
  21.   {
  22.     \cd "$@" || return
  23.     PS1="`basename $PWD` $ "     # or something to that effect
  24.   }
  25.  
  26.   alias cd=_cd
  27.  
  28. Then just stick that lot in your .profile or .kshrc.
  29.  
  30. Des.
  31. -- 
  32. Des Herriott,           /     "...and I hate, and I hate, and I hate,
  33. Micro Focus, Newbury.  /             elevator music..."
  34. +44 (0635) 565354     /
  35. dnh@mfltd.co.uk      /                   -- Tori Amos, Little Earthquakes.
  36.