Hi everyone,
I have a problem with defining bash aliases.
I have tried putting them in ~/.bash_aliases as I do in Ubuntu, and I have also tried to put them in ~/.bashrc but i can't get them to work.
I'm using Lucid 5.2.8
How do I define "persistent" bash aliases? (Solved)
How do I define "persistent" bash aliases? (Solved)
Last edited by rga on Sat 03 Sep 2011, 18:02, edited 1 time in total.
Re: How do I define "persistent" bash aliases?
.bashrc should work, but you'd have to start a new term (or source the dotfile) to see it in the current session.rga wrote:Hi everyone,
I have tried putting them in ~/.bash_aliases as I do in Ubuntu, and I have also tried to put them in ~/.bashrc but i can't get them to work.
Eee 900 (16GB SSD), 2GB RAM, Puppy Linux 5.1.1
Re: How do I define "persistent" bash aliases?
Thank you!fratermus wrote:.bashrc should work, but you'd have to start a new term (or source the dotfile) to see it in the current session.rga wrote:Hi everyone,
I have tried putting them in ~/.bash_aliases as I do in Ubuntu, and I have also tried to put them in ~/.bashrc but i can't get them to work.
Starting a new terminal or running the file from the terminal didn't work (or maybe I did something wrong).
But after a reboot the aliases defined in .bashrc were loaded when i opened the terminal
Re: How do I define "persistent" bash aliases?
Running a script (like .bashrc) by name like that really means "load a child shell, run this script in that child shell, then close that shell and fall back to the current/parent shell". In this manner changes made in the child die with it and are not available to the parent unless you go out of your way to preserve them.rga wrote:Starting a new terminal or running the file from the terminal didn't work (or maybe I did something wrong).
But after a reboot the aliases defined in .bashrc were loaded when i opened the terminal
". .bashrc" would keep the aliases as long as you were in that terminal session. The first dot means "source the following file", basically as if you typed it on the (current) shell. It does not invoke a child shell.
I hope I have not made matters worse.
Last edited by fratermus on Mon 05 Sep 2011, 13:53, edited 1 time in total.
Eee 900 (16GB SSD), 2GB RAM, Puppy Linux 5.1.1