Bug 8592 - /etc/profile & /etc/bashrc violate PS1 conventions and prevent ~/.inputrc from working at all
/etc/profile & /etc/bashrc violate PS1 conventions and prevent ~/.inputrc fro...
Product: Red Hat Linux
Classification: Retired
Component: setup (Show other bugs)
All Linux
medium Severity high
: ---
: ---
Assigned To: Bill Nottingham
Depends On:
  Show dependency treegraph
Reported: 2000-01-19 00:21 EST by Stig Hackvan
Modified: 2014-03-16 22:12 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2000-02-16 12:48:34 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Stig Hackvan 2000-01-19 00:21:27 EST
PS1 is _supposed to be unset_ when the shell is non-interactive.  Since 5.2
and perhaps before that, the redhat default environment has gone to great
lengths to break this behavior.  (so much for peer review.)

here's my repair script which does roughly what needs to be done...
{modify the export line to not export PS1 or INPUTRC to be 100% correct}

report() { echo "$@" 1>&2 ; }

if egrep -qs ^INPUTRC= /etc/profile; then
  report "fixing /etc/profile and creating /etc/skel/.inputrc"
  perl -pi~ -e 's,^(INPUTRC=),# $1,' /etc/profile
  echo '$include /etc/inputrc' >/etc/skel/.inputrc

if egrep -qs ^PS1= /etc/profile; then
  report "don't unconditionally set PS1 in /etc/profile !!!!"
  perl -pi~ -e 's,^(PS1=),test "\$PS1" && $1,' /etc/profile /etc/bashrc
Comment 1 Bill Nottingham 2000-02-16 12:48:59 EST
fixed in setup-2.1.6.

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