[UCLA-LUG] /etc/profile and /etc/bashrc files
MIng Yu
mingqiang.yu@anderson.ucla.edu
Fri, 12 May 2000 11:28:00 -0700 (Pacific Daylight Time)
I've tried to put some system environment
variables in /etc/profile and system alias in
/etc/bashrc files. It seems that when I log in,
the system environment variables are recognized
while system alias are not(at the end of
/etc/bashrc, alias ls='ls -a --color'. The
followings are my /etc/profile and /etc/bashrc
file. My login shell is the linux default shell,
bash shell.
Thanks for your help.
/etc/profile:
# /etc/profile
# System wide environment and startup programs
# Functions and aliases go in /etc/bashrc
PATH="$PATH:/usr/X11R6/bin"
PS1="[\u@\h \W]\\$ "
ulimit -c 1000000
if [ `id -gn` = `id -un` -a `id -u` -gt 14 ]; then
umask 002
else
umask 022
fi
USER=`id -un`
LOGNAME=$USER
MAIL="/var/spool/mail/$USER"
HOSTNAME=`/bin/hostname`
HISTSIZE=1000
HISTFILESIZE=1000
INPUTRC=/etc/inputrc
export PATH PS1 USER LOGNAME MAIL HOSTNAME HISTSIZE HISTFILESIZE INPUTRC
for i in /etc/profile.d/*.sh ; do
if [ -x $i ]; then
. $i
fi
done
unset i
/etc/bashrc
# /etc/bashrc
# System wide functions and aliases
# Environment stuff goes in /etc/profile
# For some unknown reason bash refuses to inherit
# PS1 in some circumstances that I can't figure out.
# Putting PS1 here ensures that it gets loaded every time.
PS1="[\u@\h \W]\\$ "
alias ls = 'ls -a --color'
ming
----------------------