Bug 159522 - /etc/bashrc is parsed in the wrong order from user's .bashrc
Summary: /etc/bashrc is parsed in the wrong order from user's .bashrc
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: bash
Version: 3
Hardware: All
OS: Linux
medium
low
Target Milestone: ---
Assignee: Tim Waugh
QA Contact: Ben Levenson
URL: http://www.greenshire.com/notes/linux/
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2005-06-03 14:58 UTC by Keith Howanitz
Modified: 2007-11-30 22:11 UTC (History)
0 users

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2005-07-25 10:03:05 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Keith Howanitz 2005-06-03 14:58:23 UTC
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
fi
----------
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
fi

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


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

How reproducible:
Always

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 19:05:45 UTC
/etc/skel/.bashrc is part of the bash package.

Comment 2 Tim Waugh 2005-06-08 08:56:22 UTC
Fixed in CVS.


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