Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
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
Alias: None
Product: Fedora
Classification: Fedora
Component: bash
Version: 3
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Tim Waugh
QA Contact: Ben Levenson
Depends On:
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:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2005-07-25 10:03:05 UTC

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
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 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.