Bug 17271 - Bash prompt processing of \$ macro fails
Bash prompt processing of \$ macro fails
Status: CLOSED NOTABUG
Product: Red Hat Linux
Classification: Retired
Component: bash (Show other bugs)
6.2
i386 Linux
low Severity low
: ---
: ---
Assigned To: Bernhard Rosenkraenzer
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2000-09-06 00:06 EDT by Mike A. Harris
Modified: 2008-05-01 11:37 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2000-09-06 00:06:55 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Mike A. Harris 2000-09-06 00:06:53 EDT
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 08:18:51 EDT
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.