![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Platform Initialization Self-Certification Test 20080120 (Default branch) | iBot | Software Releases - RSS News | 0 | 02-28-2008 01:10 AM |
| Writing a shared library --- any initialization routine? | rogeryin | UNIX for Dummies Questions & Answers | 1 | 06-22-2006 08:17 PM |
| Initialization & Startup Files | aldowsary | AIX | 2 | 02-14-2006 06:32 AM |
| Help regarding storing the initialization parameters | VENC22 | UNIX for Dummies Questions & Answers | 1 | 05-16-2005 12:16 PM |
| Struct Initialization | amatsaka | High Level Programming | 4 | 12-20-2002 07:25 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
Shell initialization files
As you know, when a user logs in, the shell reads the initialization files in an order something like below...
################### Bourne Shell /etc/profile > $HOME/.profile Bash Shell /etc/profile > $HOME/.bash_profile > $HOME/.bash_login > $HOME/.profile > $HOME/.bashrc C Shell /etc/.login > $HOME/.cshrc > $HOME/.login > $HOME/.cshrc Korn Shell /etc/profile > $HOME/.profile > $HOME/.kshrc ################### So I'm just wondering,.. why are there so many initialization files needed? Is it just me, or does it seem like this is an overly complicated way of initializing account profile settings? And please forgive me ahead of time for not understanding as I am still relatively new at this. |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
Yes but I think you are missing one point! You do not need to execute all of them! The system will run quite happily with just the profile. You can then set variables local to the user with the .profile / .kshrc etc. It is all a matter of control. You forgot /etc/environment.
|
|
#3
|
||||
|
||||
|
There is typically a "at login" script which is executed only by a login shell. A login shell will have a name starting with a hyphen. Then shells may have a secondary startup file that is executed by every shell (the login shell and any subshells) where stuff like aliases may be defined. For each file, there is a version in /etc which is systemwide and may be all you need. After the verion in /etc runs, the shell runs the version in $HOME. This gives the user a chance to override and systemwide settings.
bash needs to be able to emulate the bourne shell so it checks the bourne shell's files as well. |
|
#4
|
|||
|
|||
|
Right, but the thing I don't get is why is there so many? For instance, I can see the reasoning behind having one default one and then maybe a second one for the user account. But like bash for instance has .bashrc, .bash_profile, .bash_login, etc. And I know that it's not necessary to use all of them but it just seems like it overly complicates things to have so many available. Then not to mention, that's just for UNIX,... Linux distributions have even more. Maybe I'm still too new to this, but it seems like it would make more sense to standardize this system to all shells and all platforms.
|
|||
| Google The UNIX and Linux Forums |