home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / unix / question / 9463 < prev    next >
Encoding:
Text File  |  1992-07-27  |  1.4 KB  |  43 lines

  1. Newsgroups: comp.unix.questions
  2. Path: sparky!uunet!mnemosyne.cs.du.edu!nyx!swolfson
  3. From: swolfson@nyx.cs.du.edu (Sabina Wolfson)
  4. Subject: Question about ' " ` (sorry if reposted)
  5. Message-ID: <1992Jul27.235121.26287@mnemosyne.cs.du.edu>
  6. X-Disclaimer: Nyx is a public access Unix system run by the University
  7.     of Denver for the Denver community.  The University has neither
  8.     control over nor responsibility for the opinions of users.
  9. Sender: usenet@mnemosyne.cs.du.edu (netnews admin account)
  10. Organization: Nyx, Public Access Unix at U. of Denver Math/CS dept.
  11. Date: Mon, 27 Jul 92 23:51:21 GMT
  12. Lines: 29
  13.  
  14.  
  15. Hi - I have a "basic" question about quotes.  Let me explain what I am
  16. trying to do.  (I'm using a ksh version from 88)
  17.  
  18.  
  19. I had PS1 defined like this and it worked fine:
  20.  
  21.     PS1="`/usr/5bin/tput bold`(`hostname`) `/usr/5bin/tput rmso`"
  22.  
  23. Then I saw this cool PS1 in the "KornShell Programming Tutorial" (great
  24. book by Barry Rosenberg) that I wanted to use:
  25.  
  26.     PS1='${PWD#$HOME/} '
  27.  
  28. The only way I could get PS1 to show both the modified PWD and the
  29. hostname in bold was to do this (with a little help):
  30.  
  31.     TEMP_FRONT="`/usr/5bin/tput bold`"
  32.     TEMP_BACK="(`hostname`) `/usr/5bin/tput rmso`"
  33.     PS1='${TEMP_FRONT} ${PWD#$HOME/} ${TEMP_BACK}'
  34.  
  35. I would like to be able to do this all in one line but I cannot get the
  36. quotes right...anyone know how to do this?
  37.  
  38. Thanks,
  39. Sabina
  40.  
  41. sabina@cns.nyu.edu
  42.  
  43.