home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume3 / anotherprompt < prev    next >
Internet Message Format  |  1989-02-03  |  2KB

  1. Path: xanth!mcnc!rutgers!cmcl2!husc6!m2c!necntc!ncoast!allbery
  2. From: bsrdp@cu.warwick.ac.uk.UUCP (Mr H Boothroyd)
  3. Newsgroups: comp.sources.misc
  4. Subject: v03i070: csh prompt generator
  5. Message-ID: <11946.8807011201@sol.warwick.ac.uk>
  6. Date: 1 Jul 88 12:01:30 GMT
  7. Sender: allbery@ncoast.UUCP
  8. Reply-To: bsrdp@cu.warwick.ac.uk.UUCP (Mr H Boothroyd)
  9. Lines: 46
  10. Approved: allbery@ncoast.UUCP
  11.  
  12. Posting-number: Volume 3, Issue 70
  13. Submitted-by: "Mr H Boothroyd" <bsrdp@cu.warwick.ac.uk.UUCP>
  14. Archive-name: anotherprompt
  15.  
  16. > From: jap@syssun.cl.msu.edu (Joseph A. Porkka)
  17. > Newsgroups: comp.sources.misc: Volume 3, Issue 52
  18. > Subject: v03i052: My favorite csh prompt generator
  19.  
  20. Thank you for networking the idea. It gave me something to start on to
  21. adapt for my own use here.
  22.  
  23. I'm not sure whether a line for `popd'
  24.  
  25.      alias popd  'popd  \!* && prompt'
  26.  
  27. was lost in transmission or omitted by you.  It is needed in addition to
  28. the three lines that arrived:
  29.  
  30. >    alias cd 'cd \!* && prompt'
  31. >    alias prompt 'if ($?prompt) set prompt="! ${host}:${user} ${cwd}: "'
  32. >    alias pushd 'pushd \!* && prompt'
  33.  
  34. You may just possibly be interested in the rather heavy adaptations that I
  35. made to my .cshrc (with local help) in order to get
  36.    - a prompt that leaves out my global address when in my workspace,
  37.    - a full prompt when outside my workspace.
  38.  
  39. I can't help feeling there ought to be easier ways, but I'm not really into
  40. unix and c.
  41.  
  42.      alias plocal  'expr "$cwd" : "$HOME/\(.*\)"'
  43.      alias pglobal 'expr "$cwd" : "/\(.*\)"'
  44.      alias prompt1 'if "$cwd" =~ "$HOME"* set prompt = "! `plocal`: " '
  45.      alias prompt2 'if "$cwd" !~ "$HOME"* set prompt = "! `pglobal`: " '
  46.      alias cd      'cd \!* && prompt1 && prompt2'
  47.      alias pushd   'pushd \!* && prompt1 && prompt2'
  48.      alias popd    'popd  \!* && prompt1 && prompt2'
  49.      cd "$cwd"
  50.  
  51. -----------------------
  52. Hylton Boothroyd         Janet:  h.boothroyd@uk.ac.warwick.cu
  53. Warwick Business School  Darpa:  h.boothroyd%cu.warwick.ac.uk@cunyvm.cuny.edu
  54. University of Warwick    Uucp:   h.boothroyd%sol@warwick.uucp
  55. COVENTRY                 Earn/Bitnet: <Janet address>@UKACRL
  56. England  CV4 7AL         Phone:  +44 203 523523  Extension 2428
  57. -----------------------
  58.