home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / unix / shell / 5149 < prev    next >
Encoding:
Internet Message Format  |  1992-12-23  |  1.7 KB

  1. Path: sparky!uunet!olivea!gossip.pyramid.com!pyramid!infmx!hartman
  2. From: hartman@informix.com (Robert Hartman)
  3. Newsgroups: comp.unix.shell
  4. Subject: Re: Novice Unix user help
  5. Message-ID: <1992Dec17.030749.321@informix.com>
  6. Date: 17 Dec 92 03:07:49 GMT
  7. References: <101787@netnews.upenn.edu> <1992Dec14.214005.15179@brtph560.bnr.ca>
  8. Sender: news@informix.com (Usenet News)
  9. Organization: Informix Software, Inc.
  10. Lines: 31
  11.  
  12. In article <1992Dec14.214005.15179@brtph560.bnr.ca> esh@bnr.ca (Jim Eshelman P910) writes:
  13. >In article <101787@netnews.upenn.edu>, ericj@eniac.seas.upenn.edu (Eric J Reiter) writes:
  14. >|> Can anyone tell me how I can change my prompt to display what directory I am 
  15. >|> in; i.e. like DOS set prompt=$p$g ?
  16. >|> 
  17. >If you are in CSH, you can try:
  18. >
  19. >    alias  cd       'cd \!*; set prompt = "{`pwd`}<\! >"'
  20.  
  21. Maybe it's just me, but I find that prompt business to be quite
  22. annoying.  I also find that I can remember what directory I'm in as
  23. long as I stay there.  It's only when I move that I need to know.
  24. So I just alias cd like this:
  25.  
  26.     alias cd 'cd \!*; echo $cwd'
  27.  
  28. I also define "." as an alias for 'echo $cwd', so that when I do
  29. happen to forget, I can get a reminder in 2 keystrokes. 
  30.  
  31. (When I'm in ksh, I use "," instead.)
  32.  
  33. >but note that most of the gurus out there will likely ignore your question
  34. >since this kind of info is in the Frequently Asked Questions (FAQ) files
  35. >which were posted just last week.  Get a copy & study before venturing here
  36. >as a novice -- and provide more detail on the system you are using.
  37.  
  38. Yup.  One thing to remember about UNIX, although you can usually
  39. make it do what you want, sometimes it's less trouble to find an
  40. alternative method that will accomplish the same thing.
  41.  
  42. -r
  43.