Bug 17271 - Bash prompt processing of \$ macro fails
Summary: Bash prompt processing of \$ macro fails
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: bash
Version: 6.2
Hardware: i386
OS: Linux
low
low
Target Milestone: ---
Assignee: Bernhard Rosenkraenzer
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2000-09-06 04:06 UTC by Mike A. Harris
Modified: 2008-05-01 15:37 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2000-09-06 04:06:55 UTC
Embargoed:


Attachments (Terms of Use)

Description Mike A. Harris 2000-09-06 04:06:53 UTC
The bash manpage states that "\$" embedded in the prompt will expand to
"#" for root, or "$" for any other user.  However, when I use it, it
expands
to "$" regardless of who I am.

This isn't major critical, but I'll suspect there is a one liner of code in
bash
that is gone bad.  Please inform me if it is fixed or not, or will be fixed
soon.
If not, since it isn't anything mind blowing, I'll fix it myself if
possible..

TIA

Comment 1 Bernhard Rosenkraenzer 2000-10-05 12:18:51 UTC
It actually works here...
We're making use of \$ in bashrc - don't you get a "[root@hostname]#" prompt,
when logging in as root?
You're probably being hit by the fact that \ is a general escape character (did
you do something along the lines of PS1="\$"?)...

Try:
PS1="something\\$" (the first backslash is an escape character!)
or
PS1='something\$'




Note You need to log in before you can comment on or make changes to this bug.