Make Screen respect bash aliases
Ok.
I have many productive aliases set for myself, but I very frequently use `screen`. The only problem is, my aliases don't stick around when I use screen, they revert to the defaults. As a matter of fact, I can't even find where those defaults are. I looked (obivously) in my own .bashrc, and /etc/bashrc, and checked other bash files but they're not there! Basically, I have ll definated as ls -laF instead of just ls -l among other things. So why does screen reset it's definition? (And where in the hell are those normal defaults? [rm = rm -i, cp = cp -i, mv = mv -i, ll = ls -l, etc.]) |
Try looking in /etc/profile.
I have never had any problems with screen screwing up my aliases though. Do you define them in your .bashrc? If so, is .bashrc included in .bash_profile? If not you can make .bash_profile call .bashrc so .bashrc always will be parsed. Include this in your .bash_profile: Code:
if [ -f ~/.bashrc ]; then |
I have
if [ -f ~/.bashrc ]; then . ~/.bashrc fi In my .bash_profile. Does it have to be source ~/.bashrc? As you can see, mine is just . In addition, yes, my .bashrc contains my alias definitions. |
Well.. the file .bashrc is read by non-login shells, but screen is a login shell by default.. . so man bash states about that problem...
anyway .. try ln -s ~/.bashrc ~/.bash_login ln -s ~/.bashrc ~/.bash_profile and screen should read your aliases etc.. |
no dice.
I even ended screen and re-started it just to make sure. I checked /etc/bashrc and there's nothing in there to override the aliases, at least... not with aliases of it's own. Anything else I should be looking for? |
I've noticed some systems like to hide those defaults in /etc/profile.d
Check that directory. This is typical for RedHat/Mandrake systems. |
yep. Found that out tonight browsing through other forums and threads and such.
I moved the /etc/bashrc call to the top of my .bashrc file, and then put MY aliases and such below it. |
New problem, now the aliases aren't loading whenever I'm NOT in screen.
Obviously, logging in over SSH is a login shell, so why aren't my aliases being defined? Everything else in the .bashrc is executed properly. |
May I ~bump~ this? It's been 3 weeks, and I'd like to figure this out, but I don't understand why it's not alias'ing properly.
[edit] As it turns out, there is unalias ls and unalias ll lines in my .bash_profile... and I swear to god I didn't put them in there. Must have been my friend (root) toying with me :D. Thanks everyone. |
All times are GMT -5. The time now is 05:08 PM. |