home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: gnu.bash.bug
- Path: sparky!uunet!think.com!sdd.hp.com!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!odin.ins.cwru.edu!chet
- From: chet@odin.ins.cwru.edu (Chet Ramey)
- Subject: Re: Bug of prompt \$
- Message-ID: <9301081416.AA04043.SM@odin.INS.CWRU.Edu>
- Sender: gnulists@ai.mit.edu
- Reply-To: chet@po.cwru.edu
- Organization: GNUs Not Usenet
- References: chet@odin.ins.cwru.edu (Chet Ramey)
- Distribution: gnu
- Date: Fri, 8 Jan 1993 04:16:28 GMT
- Approved: bug-bash@prep.ai.mit.edu
- Lines: 31
-
- > I am running bash 1.12 on SunOS 4.1.1.
- > In my .bashrc, PS1 set to ...
- >
- > PS1="[\h \t \W]\$ "
- >
- > but, not work \$ at su command.Same as root login.
-
- This assignment statement is not doing what you expect. Backslashes which
- precede dollar signs in double-quoted strings are removed during expansion.
- This is specified in Posix.2 and is the traditional sh behavior.
-
- Your PS1 is really being set to `[\h \t \W]$ '. If you change the double
- quotes to single quotes in the assignment statement, things will work as
- you expect:
-
- [odin 09:21:42 sun4]$ PS1='[\h \t \W]\$ '
- [odin 09:21:50 sun4]$ export PS1
- [odin 09:21:54 sun4]$ su
- Password:
- [odin 09:21:59 sun4]#
- [odin 09:22:12 sun4]# echo -"$PS1"-
- -[\h \t \W]\$ -
-
- Chet
-
- --
- ``The use of history as therapy means the corruption of history as history.''
- -- Arthur Schlesinger
-
- Chet Ramey, Case Western Reserve University Internet: chet@po.CWRU.Edu
-
-