Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Sun 23 Feb 2020, 08:06
All times are UTC - 4
 Forum index » House Training » Users ( For the regulars )
How do I define "persistent" bash aliases? (Solved)
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [4 Posts]  
Author Message
rga

Joined: 31 Aug 2011
Posts: 2

PostPosted: Wed 31 Aug 2011, 15:49    Post subject:  How do I define "persistent" bash aliases? (Solved)  

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

Last edited by rga on Sat 03 Sep 2011, 14:02; edited 1 time in total
Back to top
View user's profile Send private message 
fratermus


Joined: 28 May 2009
Posts: 20
Location: 75081

PostPosted: Thu 01 Sep 2011, 02:05    Post subject: Re: How do I define "persistent" bash aliases?  

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.


.bashrc should work, but you'd have to start a new term (or source the dotfile) to see it in the current session.

_________________
Eee 900 (16GB SSD), 2GB RAM, Puppy Linux 5.1.1
Back to top
View user's profile Send private message Visit poster's website 
rga

Joined: 31 Aug 2011
Posts: 2

PostPosted: Sat 03 Sep 2011, 12:16    Post subject: Re: How do I define "persistent" bash aliases?  

fratermus wrote:
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.


.bashrc should work, but you'd have to start a new term (or source the dotfile) to see it in the current session.


Thank you!

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 Smile
Back to top
View user's profile Send private message 
fratermus


Joined: 28 May 2009
Posts: 20
Location: 75081

PostPosted: Mon 05 Sep 2011, 09:46    Post subject: Re: How do I define "persistent" bash aliases?  

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 Smile


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.

". .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. Smile

_________________
Eee 900 (16GB SSD), 2GB RAM, Puppy Linux 5.1.1

Last edited by fratermus on Mon 05 Sep 2011, 09:53; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website 
Display posts from previous:   Sort by:   
Page 1 of 1 [4 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » House Training » Users ( For the regulars )
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0728s ][ Queries: 11 (0.0274s) ][ GZIP on ]