You are not logged in.
Pages: 1
I've added certain aliases to my "~/.bashrc" file, such as:
alias p="pacman"
They are working for my normal user, but how can I get them to work for the root account?
Many thanks.
flack 2.0.6: menu-driven BASH script to easily tag FLAC files (AUR)
knock-once 1.2: BASH script to easily create/send one-time sequences for knockd (forum/AUR)
Offline
root has it's own dir (/root) if you add the alias to the root bashrc in /root/.bashrc it should work as expected.
Offline
Add them to your root user's .bashrc: /root/.bashrc
Offline
Additionally, if you want to make it global across all users on your system, you can do something like putting it in "/etc/profile.d/custom.sh" (and chmod +x that file).
Offline
Additionally, if you want to make it global across all users on your system, you can do something like putting it in "/etc/profile.d/custom.sh" (and chmod +x that file).
I did this, made the file, made it run as executable and inserted the command
alias pad='mousepad'
and it doesn't work. Am I stupid?
Last edited by jacko (2008-01-11 23:25:00)
Offline
i think you need to log out and log back in before that would take effect. have you done that?
archlinux - please read this and this — twice — then ask questions.
--
http://rsontech.net | http://github.com/rson
Offline
i think you need to log out and log back in before that would take effect. have you done that?
I even reboot. Nothing
Offline
rson451 wrote:i think you need to log out and log back in before that would take effect. have you done that?
I even reboot. Nothing
.bashrc is loaded when you enter command bash - no need for reboot
Zygfryd Homonto
Offline
Offline
same problem here. "$ alias" works, "root # alias" gives proper output, too. But
kaktuz ~ $ sudo alias
sudo: alias: command not found
Last edited by kakTuZ (2008-01-12 12:39:00)
Offline
Your problem right there. You can't use it that way, with sudo. Or rather, you can't use sudo that way. All my sudo aliases are in ~/. I copied over to /root and just sed all sudos There may be a way to create a function so the shell checks whether you're root or not and removes sudo before issuing the command, but i'm lazy to figure it out and also having 2 bashrcs is not gonna take up even 1MB of space.
I need real, proper pen and paper for this.
Offline
jacko wrote:rson451 wrote:i think you need to log out and log back in before that would take effect. have you done that?
I even reboot. Nothing
.bashrc is loaded when you enter command bash - no need for reboot
we are not talking about .bashrc we are talking about /etc/profile.d/custom.sh, I am trying to follow AG's advice and well it doesn't work!
Offline
If you just type "$ alias", do you see that alias listed?
no, the only alias I see listed is the one that is in .bashrc of my users ~/ directory. Again, I followed AG's advice precisely and nothing works as suggested.
Offline
It doesn't matter what we are talking about, as long as we source it So you may want to just have 2 bashrcs and get straight to work. Anyway run a checklist like (1) permissions 755? (2) sourced? to troubleshoot why this doesn't work.
Last edited by schivmeister (2008-01-12 17:27:19)
I need real, proper pen and paper for this.
Offline
Pages: 1