Die Kenntnis der Ausführungsreihenfolge der Umgebungsvariablen für verschiedene OS-Shells ist für einen Systemadministrator sehr wichtig. Dies kann nützlich sein, um Cron-Jobs einzurichten oder um Unterschiede zwischen Befehlen zu verstehen, die in einer interaktiven Shell ausgeführt werden, und Batch-Jobs, die eine nicht interaktive Shell verwenden.
1. Shell:CSH
Inbetriebnahme (Bestellung):
--> .cshrc (always) --> .login (login shells)
Kündigung:
--> .logout (login shells)
Andere:
.history (saves history based on "$savehist")
2. Shell:tcsh
Inbetriebnahme (Bestellung):
--> /etc/csh.cshrc (always) --> /etc/csh.login (login shells) --> .tcshrc (always) --> .cshrc (if no .tcshrc file is present) --> .login (login shells)
Kündigung:
-->.logout (login shells)
Andere:
--> .history (saves history based on "$savehist") --> .cshdirs (saves directory stack)
3. Schale:sch
Inbetriebnahme (Bestellung):
--> /etc/profile (login shells)
Kündigung:
Any command or script specified using the command: trap "command" 0
Andere:
--> .profile (login shells)
4. Shell:ksh
Inbetriebnahme (Bestellung):
--> /etc/profile (login shells) --> .profile (login shells) --> $ENV (always, if it is set)
Kündigung:
Any command or script specified using the command: trap "command" 0
5. Shell:bash
Inbetriebnahme (Bestellung):
--> /etc/profile (login shells) --> .bash_profile (login shells) --> .profile (login if no .bash_profile file is present) --> .bashrc (interactive non-login shells) --> $ENV (non-interactive shells)
Kündigung:
--> .bash_logout (login shells)
Andere:
--> .inputrc (readline initialization)
6. Shell:zsh
Inbetriebnahme (Bestellung):
--> .zshenv (always, unless the -f option is specified) --> .zprofile (login shells) --> .zshrc (interactive shells, unless the -f option is specified) --> .zlogin (login shells)
Kündigung:
--> .zlogout (login shells)