SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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:
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.
If I'm not missreading what I'm doing is right (I just dun know why it's not working ), and I'm pretty sure it's a loggin shell because I'm login off and on in my console .
Radicalm16.
Last edited by Radicalm16; 12-22-2003 at 10:34 PM.
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
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
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.