You are not logged in.
Pages: 1
I have an alias in my .bashrc:
alias pacman='pacman-color'
and it's also in root's .bashrc.
But when I do a 'sudo pacman' it doesn't have color. If I do 'sudo pacman-color' it has color, like it should. And if I'm root when I do 'pacman' it has color! I just copy/pasted the line from one bashrc to the other. Why the heck doesn't it work for the normal user?
Last edited by pogeymanz (2008-06-19 13:51:07)
Offline
Did you remember to do source ~/.bashrc from under your user acct?
Offline
I did. I even logged out and back in! Here is my exact .bashrc file:
alias go='startx'
alias ls='ls --color=auto'
alias pacman='pacman-color'
alias targz='tar zxvf'
alias tarbz2='tar jxvf'
#PS1='[\u@\h \W]\$ '
PS1='\[\e[0;32m[\]\e[0;37m\]\u\[\e[m\] \[\e[1;34m\]\w\[\e[m\] \[\e[0;32m]\]\[\e[0;37m\]\$ \[\e[m\]\[\e[0;32m\] '
complete -cf sudo
Offline
Login to you shell, and type `alias` (without the quotes). That will show you all the aliases currently setup ni your shell. Does it list in there?
Are you familiar with our Forum Rules, and How To Ask Questions The Smart Way?
BlueHackers // fscanary // resticctl
Offline
It does list it there:
[rob ~ ]$ alias
alias go='startx'
alias ls='ls --color=auto'
alias pacman='pacman-color'
alias tarbz2='tar jxvf'
alias targz='tar zxvf'
And my very next line was "sudo pacman -Syu" and it not colorful!
Offline
Add to root's .bash_profile
. ~/.bashrc
[git] | [AURpkgs] | [arch-games]
Offline
Here's a solution:
Offline
The problem is that sudo cleans out your environment for security reasons, this includes unaliasing everything. The solution in the link above (alias sudo="sudo ") parses the alias before sudo does this.
Offline
Very interesting. And it worked as it should! You learn something everyday.
Offline
Pages: 1