FYI: SuSE 7.3 Bash initialization
A lot of things happen when you login to SuSE with a bash shell. I've tried to document where important things are happening here in case you want to know. If not, please ignore :) If someone sees a glaring error, please let me know. I realize that some of this will likely change in 8.0, but it still may be useful. Best Regards, Keith SuSE 7.3 BASH INITIALIZATION note: The process works a little differently if you are running a different shell (zsh, ksh, [t]csh, etc.) The files are processed in this order: /etc/profile -- global config, initializes the terminal (sets the TERM variable and unsets TERMCAP since SuSE uses terminfo instead of termcap), sets umask 022, sets initial PATH, MANPATH and a few other variables, sources /etc/SuSEconfig/profile, sources all *.sh files in /etc/profile.d/, sources /etc/bash.bashrc, sources ~/.bashrc. It includes code to prevent ~/.bashrc from running more than once depending on whether it has already been executed. /etc/SuSEconfig/profile -- this file is generated by SuSEconfig from settings in the /etc/rc.config file. It sets language environment variables, KDEDIR, QTDIR, PRINTER and WINDOWMANAGER. /etc/profile.d/*.sh -- application specific settings such as jade_dsl.sh, medusa-idled.sh (search engine used by nautilus), sp.sh, tetex.sh. Most of these were not activated for my installation. /etc/bash.bashrc -- sets some shell functions (startx and remount), also sets some aliases (+=pushd, -=popd, o=less, others), sets the PS1 variable which controls the format of the prompt, sets other variables, if bash 2.0+ it also sources /etc/profile.d/complete.bash. /etc/profile.d/complete.bash -- sets a couple of shell options (shopt), customizes the bash "complete" builtin behavior (file completion). SuSE did some serious work to optimize this part of the bash configuration. ~/.bashrc -- finally, your own bash settings are run. You can override anything that has been set previously since this file is sourced last (prompt, variables, etc.). The default SuSE .bashrc includes code to check for /etc/profile.dos and sources it if it exists. It also checks for ~/.alias and sources it if it exists. /etc/profile.dos -- sets up aliases for DOS commands (del, move, copy, etc.) ~/.alias -- best place to put your custom alias definitions. Then, bash looks for additional config files to run... For login shells, it looks for these files, in order, and executes commands from the FIRST one that exists and is readable. ~/.bash_profile -- doesn't exist by default. ~/.bash_login -- doesn't exist by default. You can create it and put custom commands here that you only want to happen once when you first login. If this file exists, the the ~/.profile will not run. Normally, this is not a problem since ~/.profile does not do much and the ~/.bashrc gets sourced from /etc/profile. ~/.profile -- sets LANG variable, sources /etc/profile IF it has not already been run (checks PROFILEREAD variable), sources ~/.bashrc, runs the fortune program if you uncomment it. For interactive non-login shells, bash looks for this file: ~/.bashrc -- this is where most custom user settings should go. When you logout, it looks for this file: ~/.bash_logout -- file doesn't exist by default. If you want to do something every time you logout, create this file and load it up.
* Keith Winston;
A lot of things happen when you login to SuSE with a bash shell. I've tried to document where important things are happening here in case you want to know. If not, please ignore :)
I'll make sure they can not ignore as sometime Sunday SuSE FAQ will be updated :-) Great docu thanks -- Togan Muftuoglu Unofficial SuSE FAQ Maintainer http://dinamizm.ath.cx
On Thu, Apr 11, 2002 at 09:16:45PM +0300, Togan Muftuoglu wrote:
I'll make sure they can not ignore as sometime Sunday SuSE FAQ will be updated :-)
Great docu thanks
Togan, I wanted to run this by the group for a little quality check before shipping it off to you. There has already been one post that found a call to /etc/profile.local that I missed. I have reposted the fixed version below. If there are any more updates, I'll just wait until they stop before reposting any more versions. Best Regards, Keith SuSE 7.3 Bash Initialization This is an overview of what gets set where when you use a bash shell in SuSE. The process works a little differently if you are running a different shell (zsh, ksh, [t]csh, etc.). The files are processed in this order: /etc/profile -- global config, initializes the terminal (sets the TERM variable and unsets TERMCAP since SuSE uses terminfo instead of termcap), sets umask 022, sets initial PATH, MANPATH and a few other variables, sources /etc/SuSEconfig/profile, sources all *.sh files in /etc/profile.d/, sources /etc/profile.local, sources /etc/bash.bashrc, sources ~/.bashrc. It includes code to prevent ~/.bashrc from running more than once depending on whether it has already been executed. /etc/SuSEconfig/profile -- this file is generated by SuSEconfig from settings in the /etc/rc.config file. It sets language environment variables, KDEDIR, QTDIR, PRINTER and WINDOWMANAGER. /etc/profile.d/*.sh -- application specific settings such as jade_dsl.sh, medusa-idled.sh (search engine used by nautilus), sp.sh, tetex.sh. Most of these were not activated for my installation. /etc/profile.local -- doesn't exist by default. Best place to put global aliases, global shell and environment variables, etc. /etc/bash.bashrc -- sets some shell functions (startx and remount), also sets some aliases (+=pushd, -=popd, o=less, others), sets the PS1 variable which controls the format of the prompt, sets other variables, if bash 2.0+ it also sources /etc/profile.d/complete.bash. /etc/profile.d/complete.bash -- sets a couple of shell options (shopt), customizes the bash "complete" builtin behavior (file completion). SuSE did some serious work to optimize this part of the bash configuration. ~/.bashrc -- finally, your own bash settings are run. You can override anything that has been set previously since this file is sourced last (prompt, variables, etc.). The default SuSE .bashrc includes code to check for /etc/profile.dos and sources it if it exists. It also checks for ~/.alias and sources it if it exists. /etc/profile.dos -- sets up aliases for DOS commands (del, move, copy, etc.) ~/.alias -- best place to put your custom alias definitions. Then, bash looks for additional config files to run... For login shells, it looks for these files, in order, and executes commands from the FIRST one that exists and is readable. ~/.bash_profile -- doesn't exist by default. ~/.bash_login -- doesn't exist by default. You can create it and put custom commands here that you only want to happen once when you first login. If this file exists, the the ~/.profile will not run. Normally, this is not a problem since ~/.profile does not do much and the ~/.bashrc gets sourced from /etc/profile. ~/.profile -- sets LANG variable, sources /etc/profile IF it has not already been run (checks PROFILEREAD variable), sources ~/.bashrc, runs the fortune program if you uncomment it. For interactive non-login shells, bash looks for this file: ~/.bashrc -- this is where most custom user settings should go. When you logout, it looks for this file: ~/.bash_logout -- file doesn't exist by default. If you want to do something every time you logout, create this file and load it up.
Hi Keith, I use a profile.local in /etc to set a few environment variables and aliases. The issue came up for me when trying to set some env variables to compile some sample KDE programming exercises. I think my docs in 7.2pro say to use the profile.local instead of altering profile. Anyhow, if one exists it would kick in somewhere near the end of your outline. It still works well for me and I didn't know about .bashrc at the time. Tom On Thursday 11 April 2002 08:56, Keith Winston wrote:
A lot of things happen when you login to SuSE with a bash shell. I've tried to document where important things are happening here in case you want to know. If not, please ignore :)
If someone sees a glaring error, please let me know. I realize that some of this will likely change in 8.0, but it still may be useful.
Best Regards, Keith
SuSE 7.3 BASH INITIALIZATION
note: The process works a little differently if you are running a different shell (zsh, ksh, [t]csh, etc.)
The files are processed in this order:
/etc/profile -- global config, initializes the terminal (sets the TERM variable and unsets TERMCAP since SuSE uses terminfo instead of termcap), sets umask 022, sets initial PATH, MANPATH and a few other variables, sources /etc/SuSEconfig/profile, sources all *.sh files in /etc/profile.d/, sources /etc/bash.bashrc, sources ~/.bashrc. It includes code to prevent ~/.bashrc from running more than once depending on whether it has already been executed.
/etc/SuSEconfig/profile -- this file is generated by SuSEconfig from settings in the /etc/rc.config file. It sets language environment variables, KDEDIR, QTDIR, PRINTER and WINDOWMANAGER.
/etc/profile.d/*.sh -- application specific settings such as jade_dsl.sh, medusa-idled.sh (search engine used by nautilus), sp.sh, tetex.sh. Most of these were not activated for my installation.
/etc/bash.bashrc -- sets some shell functions (startx and remount), also sets some aliases (+=pushd, -=popd, o=less, others), sets the PS1 variable which controls the format of the prompt, sets other variables, if bash 2.0+ it also sources /etc/profile.d/complete.bash.
/etc/profile.d/complete.bash -- sets a couple of shell options (shopt), customizes the bash "complete" builtin behavior (file completion). SuSE did some serious work to optimize this part of the bash configuration.
~/.bashrc -- finally, your own bash settings are run. You can override anything that has been set previously since this file is sourced last (prompt, variables, etc.). The default SuSE .bashrc includes code to check for /etc/profile.dos and sources it if it exists. It also checks for ~/.alias and sources it if it exists.
/etc/profile.dos -- sets up aliases for DOS commands (del, move, copy, etc.)
~/.alias -- best place to put your custom alias definitions.
Then, bash looks for additional config files to run...
For login shells, it looks for these files, in order, and executes commands from the FIRST one that exists and is readable.
~/.bash_profile -- doesn't exist by default.
~/.bash_login -- doesn't exist by default. You can create it and put custom commands here that you only want to happen once when you first login. If this file exists, the the ~/.profile will not run. Normally, this is not a problem since ~/.profile does not do much and the ~/.bashrc gets sourced from /etc/profile.
~/.profile -- sets LANG variable, sources /etc/profile IF it has not already been run (checks PROFILEREAD variable), sources ~/.bashrc, runs the fortune program if you uncomment it.
For interactive non-login shells, bash looks for this file: ~/.bashrc -- this is where most custom user settings should go.
When you logout, it looks for this file: ~/.bash_logout -- file doesn't exist by default. If you want to do something every time you logout, create this file and load it up.
On Thu, Apr 11, 2002 at 11:22:29AM -0700, Thomas Nicholson wrote:
Hi Keith, I use a profile.local in /etc to set a few environment variables and aliases. The issue came up for me when trying to set some env variables to compile some sample KDE programming exercises.
I think my docs in 7.2pro say to use the profile.local instead of altering profile. Anyhow, if one exists it would kick in somewhere near the end of your outline. It still works well for me and I didn't know about .bashrc at the time. Tom
Thanks, Tom, I missed it at first. It is sourced from /etc/profile just after the /etc/profile.d/*.sh scripts if your shell is NOT ash. I've updated my documentation and will repost. Best Regards, Keith -- LPIC-2, MSCE, N+ I can C for miles and miles Got spam? Get SPASTIC http://spastic.sourceforge.net
participants (3)
-
Keith Winston
-
Thomas Nicholson
-
Togan Muftuoglu