Active Topics

 


Reply
Thread Tools
Posts: 9 | Thanked: 11 times | Joined on Oct 2010
#1
I've tried to add aliases to the .bashrc and .bash_profile in the ~/home/nemo folder, but for some reason they are not recognized. However if I add them from the CLI, they work for the time of the bash session at the time. Has anyone succeeded in adding persistent aliases to bash profiles?
 
pichlo's Avatar
Posts: 6,447 | Thanked: 20,981 times | Joined on Sep 2012 @ UK
#2
Probably completely missing the mark since I do not have a Jolla and base this entirely on my experience with the N900 (not even N9) but...

Do you have ,profile in the user's home dir? I didn't and my .bashrc updates were ignored too. There was one in /root that basically checked if .bashrc existed and if so, ran it. Copying that across with minor changes (e.g. not adding root stuff to PATH) solved the problem.

As I say, possibly irrelevant but at least I have bumped your thread for someone more erudite to give you a better answer.
 
Posts: 1,298 | Thanked: 2,277 times | Joined on May 2011
#3
From the bash man page:

When bash is invoked as an interactive login shell, or as a non-interactive shell with the --login option, it first reads and executes commands from the file /etc/profile, if that file exists. After reading that file, it looks for ~/.bash_profile, ~/.bash_login, and ~/.profile, in that order, and reads and executes commands from the first one that exists and is readable. The --noprofile option may be used when the shell is started to inhibit this behavior.

When an interactive shell that is not a login shell is started, bash reads and executes commands from /etc/bash.bashrc and ~/.bashrc, if these files exist. This may be inhibited by using the --norc option. The --rcfile file option will force bash to read and execute commands from file instead of /etc/bash.bashrc and ~/.bashrc.
According to this, .bash_profile has precedence for the login shell over .profile, so not sure why it fails for you.

Last edited by shmerl; 2013-12-16 at 23:43.
 
Reply


 
Forum Jump


All times are GMT. The time now is 08:26.