LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   created ~/.bashrc doesn't work (https://www.linuxquestions.org/questions/slackware-14/created-%7E-bashrc-doesnt-work-227282/)

Alfexy 09-06-2004 08:58 AM

created ~/.bashrc doesn't work
 
Hi,
I use Slackware 9.1 and discovered that I have no .bashrc in my home folder. I searched in the forum for this problem and everybody said simply to create a new: but it does't work!

when I login or start a new terminal it doesn't run the script (change color, export etc.)
I tried with and without to set it as executable (chmod +x)...

and does anybody know where to add scripts which only run one time when I start linux. Like bashrc but global.

Thank you and linuxquestions.org

slackie1000 09-06-2004 09:06 AM

hi there...

typing "bash" will make the trick.
probably your default shell is not bash : you can check that with finger
you need to change it : /etc/passwd
in the line that contains the user ,
change /bin/whatever to /bin/bash

cheers

slackie1000

Alfexy 09-06-2004 09:32 AM

thank you slackie1000
when I type bash the the script works!
but not when i log in normally. In /etc/passwd all users are set to /bin/bash.
when I start root the command line is like this:
root@xar600:~#
other users are:
bash-2.05b$

In other users it works but not in root!!

usercsr 09-06-2004 09:50 AM

What terminal are you using? If you are using gnome-terminal, then to to the second tab in prefenrences ('Title and Command') and check the 'Run command as login shell' option.

trickykid 09-06-2004 10:19 AM

For Slackware and for the generic default .bash_profile settings do this:

As the user in your home directory:

cat /etc/bash_profile > .bashrc > .bash_profile

This will copy the default bash_profile in /etc to your home directory for users own settings. Then just edit the file how you want it.

mirradric 09-06-2004 10:20 AM

Are you logging in from console? If it is so, you are starting a login shell and .basrc is not executed. You need to use .profile or .bash_profile for login shells.

Alfexy 09-06-2004 10:34 AM

Great Thanks To all!!!
 
Thanks 2 all!

I'll try to what you say, but this won't be my last question....

Alfexy.

Nikon01 09-06-2004 01:58 PM

Well if the above stuff doesn't work you can always slap all your stuff in one .sh file in /etc/profile.d/ and chmod +x it. It will run on startup and you can still set different stuff for different users like the PS1 thing.


All times are GMT -5. The time now is 06:46 AM.