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 |
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 |
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!! |
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.
|
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. |
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.
|
Great Thanks To all!!!
Thanks 2 all!
I'll try to what you say, but this won't be my last question.... Alfexy. |
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. |