Today (Saturday) We will make some minor tuning adjustments to MySQL.

You may experience 2 up to 10 seconds "glitch time" when we restart MySQL. We expect to make these adjustments around 1AM Eastern Daylight Saving Time (EDT) US.

Shell initialization files

Thread Tools Search this Thread
# 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. Smilie
# 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.

Thread Tools Search this Thread
Search this Thread:
Advanced Search

More UNIX and Linux Forum Topics You Might Find Helpful
Variable initialization
Hallo Team, I have a simple request and i would appreciate your help. I would like to use two dates in my script lets: A=$(date +"%d %B %Y") echo $A 23 June 2014 That's awesome now we cooking. Now i want B to be on the previous month eg: echo $B Should give me 23 May 2014 I would...... Shell Programming and Scripting
Shell Programming and Scripting
Initialization error
new to shell scripting. below line is showing error in script. ${parameter:=word} in the o/p first it shows the below error. word: not found. and then in next line print "word" ---------------- p2: word: not found. word --------------------------- OS is AIX and shell is...... Shell Programming and Scripting
Shell Programming and Scripting
Char initialization
Hi All, char a="\0"; a) a contains \0 a contains garbage value b) a contains \ a contains 0 a contains garbage value Pls, let me know correct result is a or b. I guess a. Thanks, Naga:cool:... Programming
Initialization & Startup Files
Hi Every Body, I want to know which files are read by the system during startup (initialization files) & in which order they are read?... AIX
Struct Initialization
Hi We are using a code generator for initializing structures with the #define macro. Compiling it with the GCC 2.8.1 (with -ansi) it OK. But when we are using the SUN C 5.0 compiler it screams. Following is a code sample: #include <stdlib.h> #include <stdio.h> typedef struct TEST3 {...... Programming

Featured Tech Videos