home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / gnu / bash / bug / 720 < prev    next >
Encoding:
Text File  |  1993-01-08  |  1.4 KB  |  46 lines

  1. Newsgroups: gnu.bash.bug
  2. Path: sparky!uunet!think.com!sdd.hp.com!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!odin.ins.cwru.edu!chet
  3. From: chet@odin.ins.cwru.edu (Chet Ramey)
  4. Subject: Re: Bug of prompt \$
  5. Message-ID: <9301081416.AA04043.SM@odin.INS.CWRU.Edu>
  6. Sender: gnulists@ai.mit.edu
  7. Reply-To: chet@po.cwru.edu
  8. Organization: GNUs Not Usenet
  9. References: chet@odin.ins.cwru.edu (Chet Ramey)
  10. Distribution: gnu
  11. Date: Fri, 8 Jan 1993 04:16:28 GMT
  12. Approved: bug-bash@prep.ai.mit.edu
  13. Lines: 31
  14.  
  15. > I am running bash 1.12 on SunOS 4.1.1.
  16. > In my .bashrc, PS1 set to ...
  17. >   PS1="[\h \t \W]\$ "
  18. > but, not work \$ at su command.Same as root login.
  19.  
  20. This assignment statement is not doing what you expect.  Backslashes which
  21. precede dollar signs in double-quoted strings are removed during expansion. 
  22. This is specified in Posix.2 and is the traditional sh behavior. 
  23.  
  24. Your PS1 is really being set to `[\h \t \W]$ '.  If you change the double
  25. quotes to single quotes in the assignment statement, things will work as
  26. you expect:
  27.  
  28. [odin 09:21:42 sun4]$ PS1='[\h \t \W]\$ '
  29. [odin 09:21:50 sun4]$ export PS1
  30. [odin 09:21:54 sun4]$ su
  31. Password:
  32. [odin 09:21:59 sun4]# 
  33. [odin 09:22:12 sun4]# echo -"$PS1"-
  34. -[\h \t \W]\$ -
  35.  
  36. Chet
  37.  
  38. --
  39. ``The use of history as therapy means the corruption of history as history.''
  40.     -- Arthur Schlesinger
  41.  
  42. Chet Ramey, Case Western Reserve University    Internet: chet@po.CWRU.Edu
  43.  
  44.