Networking | Hardware | Software | Multimedia | System | Unix&Linux | MBA

Home>>Unix&Linux>>bash not using my .bashrc file ????

bash not using my .bashrc file ????

peterwor
05-03-2005, 12:10 PM
Ok, I'm stumped and this is, I'm sure, a dumb question... Terminal doesn't appear to be using . hidden .bashrc file in my home directory. It appears to be using the system wide "bashrc" non-hidden file in the /etc directory. Yet Path Finder correctly uses my .bashrc file.
What am I missing ???

TIA,
Peter

jeffo
05-03-2005, 01:17 PM
ok here is what i did to customize my terminal settings. open up a terminal window and that should dump you right in your home dir.

type:
pico .bash_profile

then hit return, this will open up pico and an empty file. I put this in that file and then saved my changes (this changes my prompt to what i like too):

# ~/.bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi

PS1='-----------------------------\n\n\h(\u):\w \n\d \t (-\#-) $ '

then i created a .bashrc file by typing:
pico .bashrc

and then putting my alias' and what not in that file. logging out and back in will reload the files, or you should be able to type:
source .bash_profile

good luck.

hayne
05-03-2005, 02:11 PM
What am I missing ???
It's actually a somewhat tricky issue.
If you read the bash man page ('man bash'), in the section on startup files, it explains which files are read when.
The tricky part is that there are two types of shells: "login" shells and "non-login" shells, and bash reads different files depending on the type of shell.
A "login" shell reads ~/.profile but not ~/.bashrc
A "non-login" shell reads ~/.bashrc but not ~/.profile

A new Terminal window starts a "login" shell and hence reads ~/.profile but not ~/.bashrc
The situation is reversed for xterm (under X11).
It seems (I haven't tried it) that the same is true for the terminal windows opened by PathFinder.


 

TOP

Windows Server Outsell
Unix Signals And C++ E

For more info

Unix Signals And C++ E
Windows Server Outsell
ssh setup for password
Bash script does not w
esc code 
ARD send unix command 
question about binarie
Scanning mail 
Issuing multiple comma
How do I install Linux

News Archive

/etc/hosts? 
Manually Start a Start
mounting missed hard d
Using Netinfo in Singl
darwin/bsd login probl
system_profiler and fi
Send mail from script 
mounting a drive 
OS X disk first aid ha
system.log shows steal

Related stories:

Terminal Keybindings
configure: error: C compiler cannot create executables
gtk2 build fails
Darwin 8.0 and Mac OS X 10.3.9
Can't exit Man pages in Tiger
small backups on a USB stick?
Fink and/or DarwinPorts?

Copyright@2004-2005 www.zzcoke.com All Right Reserved

advanced web statistics