Quote:
Originally Posted by T3slider
Code:
$ grep -vh "^[[:space:]]*#" /etc/profile.d/*.sh | grep alias
alias ls='/bin/ls ${=LS_OPTIONS}'
alias dir='/bin/ls ${=LS_OPTIONS} --format=vertical'
alias vdir='/bin/ls ${=LS_OPTIONS} --format=long'
alias ls='/bin/ls $LS_OPTIONS'
alias dir='/bin/ls $LS_OPTIONS --format=vertical'
alias vdir='/bin/ls $LS_OPTIONS --format=long'
alias d=dir
alias v=vdir
alias mc='. /usr/share/mc/bin/mc-wrapper.sh'
That output grabs all of the aliases in Slackware 13.1.
|
Including some you wouldn't want in a .bashrc. Those first 3 ls aliases are variants for zsh that use a zsh specific syntax (it does word splitting differently)
.
Might be better just to do this as a one off and then edit the resulting .bashrc to taste
Code:
bash -l -c alias >> ~/.bashrc
or, if you don't want to tailor it and just want the aliases to be inherited as is from /etc/profile + /etc/profile.d/*.sh just add the following line to the top of your .bashrc
Code:
source <( bash -l -c alias )
I agree with your other points though. .bashrc is the appropriate place for them, and for the bash specific PS1= string which really shouldn't be exported from /etc/profile
(To see why exporting the PS1 string is a bad idea; run a 'bash -l' and then from within that shell start either ash or ksh.)
To tie things together nicely I use a ~/.bash_profile as follows:
Code:
case $- in
*i* ) # Interactive shell
if [ -f ~/.bashrc ]; then
source ~/.bashrc
fi
;;
esac
and then my aliases/PS1 defined in ~/.bashrc