Bugzilla will be upgraded to version 5.0 on a still to be determined date in the near future. The original upgrade date has been delayed.
Bug 159522 - /etc/bashrc is parsed in the wrong order from user's .bashrc
/etc/bashrc is parsed in the wrong order from user's .bashrc
Product: Fedora
Classification: Fedora
Component: bash (Show other bugs)
All Linux
medium Severity low
: ---
: ---
Assigned To: Tim Waugh
Ben Levenson
Depends On:
  Show dependency treegraph
Reported: 2005-06-03 10:58 EDT by Keith Howanitz
Modified: 2007-11-30 17:11 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2005-07-25 06:03:05 EDT
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 Keith Howanitz 2005-06-03 10:58:23 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.8) Gecko/20050513 Fedora/1.0.4-1.3.1 Firefox/1.0.4

Description of problem:
Here is the default .bashrc created for a new user:
# .bashrc

# User specific aliases and functions

# Source global definitions
if [ -f /etc/bashrc ]; then
        . /etc/bashrc
However, by putting the source global definitions /after/ the user specific aliases and functions will cause the global definitions to overwrite the user specific aliases when, for example starting the gnome terminal.  e.g.:
alias ls='ls -aF --color' will be overwritten by alias in /etc/bashrc if put above #Source global definitions.
Moving the comment orders will fix the problem - the order below will work as the user expects:
# .bashrc

# Source global definitions
if [ -f /etc/bashrc ]; then
        . /etc/bashrc

# User specific aliases and functions
alias ls='ls -aF --color'

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. add alias ls='ls -aF --color' to default .bashrc as 4th line
2. start gnome-terminal
3. ls

Actual Results:  returned ls -F --color

Expected Results:  returned ls -aF --color

Additional info:
Comment 1 Bill Nottingham 2005-06-03 15:05:45 EDT
/etc/skel/.bashrc is part of the bash package.
Comment 2 Tim Waugh 2005-06-08 04:56:22 EDT
Fixed in CVS.

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