Bug 8518 - unconditional assignment of PS1 in /etc/bashrc problematic
Summary: unconditional assignment of PS1 in /etc/bashrc problematic
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: bash
Version: 6.1
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Bernhard Rosenkraenzer
QA Contact:
Keywords: FutureFeature
Depends On:
TreeView+ depends on / blocked
Reported: 2000-01-16 19:25 UTC by Steve Coile
Modified: 2008-05-01 15:37 UTC (History)
0 users

Clone Of:
Last Closed: 2000-07-27 18:26:02 UTC

Attachments (Terms of Use)

Description Steve Coile 2000-01-16 19:25:51 UTC
Instead of unconditionally assigning a value to $PS1 in /etc/bashrc,could
we provide some intelligence to it?

	test "${PS1}" = 'bash\$ ' && PS1="[\u@\h \W]\\$ "

This allows the redefinition of $PS1 via the "env" command:

	env PS1='something> ' /bin/bash

which is handy if you have a script that sets up a special environment
(such as an extended $PATH) before dropping the user into a subshell, while
still preserving as much of the the user's own shell preferences as
possible.  The only alternative is to have a specialized bashrc that
invokes the user's own before customing the environment, which is extremely
cumbersome given this simple alternative.

This request also includes any /etc/bashrc included with the "bash2"


Comment 1 Bernhard Rosenkraenzer 2000-01-17 11:32:59 UTC
Fixed in bash1... Reassigning you to whoever owns bash2. ;)

Comment 2 Bernhard Rosenkraenzer 2000-08-08 11:46:41 UTC

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