~/.bash_profile not being executed at login
this is what my ~/.bash_profile has:
offtopic@pits:~$ cat .bash_profile #!/bin/sh PATH=$PATH:$HOME/things/bin and it's not working. offtopic@pits:~$ echo $PATH /usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/usr/games:/opt/www/htdig/bin:/opt/kde/bin:/usr/lib/qt-3.1.2/bin:/usr/share/texmf/bin Can anyone tell me what's going on??? thnx. Radicalm16. |
check your /etc/profile
file and it problably links somewhere around line 10 - 15 to .inputrc instead of .bashrc, you can leave that and add the line source ~/.bashrc check out the man page /etc/profile (man /etc/profile) it tells you everything else. you may or may not need to know. also please post your results, whether this works or not.. |
If I force it from /etc/profile it should work but I'm posting 'cuz I have other Slack box with the same configuration (~/.bash_profile with the same lines on it and no ~/.bashrc) and it's working there...
BTW I also tried to put the script inside ~/.bashrc ( and source $HOME/.bashrc in ~/.bash_profile) and didn't work neigther. Quote from the man pages for bash at the Invocation section: Quote:
Radicalm16. |
Solved.
I just made a sym link of my ~/.bash_profile as ~/.profile Now, I dun know why it did work.:confused: Radicalm16. |
afaik:
.bashrc is read by non-login shells .bash_login is read by login-shells .bash_profile is not used in my configuration :D |
Just for information...
there is a question of priority - that I don't know very well. In fact, i had the same problem. My solution was : erase the .profile file... If this file exist, somehow .bash* is ignored.. I didn't understand .... But now it is working how I want.. Regards Slackie |
Re: ~/.bash_profile not being executed at login
Quote:
PATH="$PATH:$HOME/things/bin" I might be wrong, but in my .bash_profile I've got my PATH variable between double quotes, i.e. "" |
on ubuntu, it appears non-login shells get /dev/null 'd
I looked in /etc/profile and found out it executes a file name /etc/bash.bashrc. in bash.bashrc there is a line right after the line that says: # If not running interactively, don't do anything
if [ -z "$PS1" ] && return I changed this to: # If not running interactively, don't do anything if [ -z "$PS1" ]; then if [ -r ~/.bash_profile ]; then . ~/.bash_profile fi return fi and now it works the way I think it should. I have a .bash_profile that needs to run once to set up some at jobs, then .bashrc as many times as I use the terminal of course. I won't put this setup at jobs in the .bashrc file as i would get multiple at jobs everytime I executed another xterm. anyway, if anyone has a better way on ubuntu let me know, because I have a sneaking suspicion that everytime I upgrade the o/s, it will overwrite what I did in /etc/bash.bashrc jerry |
Hi,
Welcome to LQ & the Slackware forum. You should look at the post date. A six year old thread. :( You could setup a conditional in your '.bash_profile' that would test then perform your settings within the '.bashrc' conditionally. You could post within the Ubuntu forum to point out what you are attempting. Not only would you get relative replies from Ubuntu people but they too could respond back possible other methods. |
I think you want to create your bash customizations in a .bash_login file. You could do ln -s .bashrc .bash_login if you wanted to use the same settings for non-interactive and interactive: you might want to use some caution if Ubuntu does a lot of customizations like checking for mail, etc. as this could screw up remote logins.
|
All times are GMT -5. The time now is 03:55 AM. |