Conoscere l'ordine di esecuzione delle variabili di ambiente per diverse shell del sistema operativo è molto importante per un amministratore di sistema. Questo potrebbe essere utile per impostare i lavori cron o per comprendere le differenze tra i comandi eseguiti in una shell interattiva e i lavori batch che utilizzano una shell non interattiva.
1. Shell:CSH
Avvio (ordine):
--> .cshrc (always) --> .login (login shells)
Risoluzione:
--> .logout (login shells)
Altri:
.history (saves history based on "$savehist")
2. Conchiglia:tcsh
Avvio (ordine):
--> /etc/csh.cshrc (always) --> /etc/csh.login (login shells) --> .tcshrc (always) --> .cshrc (if no .tcshrc file is present) --> .login (login shells)
Risoluzione:
-->.logout (login shells)
Altri:
--> .history (saves history based on "$savehist") --> .cshdirs (saves directory stack)
3. Conchiglia:sh
Avvio (ordine):
--> /etc/profile (login shells)
Risoluzione:
Any command or script specified using the command: trap "command" 0
Altri:
--> .profile (login shells)
4. Conchiglia:ksh
Avvio (ordine):
--> /etc/profile (login shells) --> .profile (login shells) --> $ENV (always, if it is set)
Risoluzione:
Any command or script specified using the command: trap "command" 0
5. Conchiglia:bash
Avvio (ordine):
--> /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)
Risoluzione:
--> .bash_logout (login shells)
Altri:
--> .inputrc (readline initialization)
6. Conchiglia:zsh
Avvio (ordine):
--> .zshenv (always, unless the -f option is specified) --> .zprofile (login shells) --> .zshrc (interactive shells, unless the -f option is specified) --> .zlogin (login shells)
Risoluzione:
--> .zlogout (login shells)