Unix Shell is a common name for command-line interpreters on Unix-like operating systems.
Login shell
A login shell is the instance of the shell that gets launched after the user logs into the machine. It is defined in the `passwd` file. Note that if one is using a WM, it manages the login shell. Thus, the terminal emulator does not open a login shell, but a non-login interactive shell.
Dotfiles
The configuration files of the shells are usually different from shell to shell, which makes it hard to set environment variables for all shells.
Here's a trimmed down table from wp>Unix shell:
sh |
bash |
zsh |
|
---|---|---|---|
|
Bourne; if interactive |
||
value of |
not everywhere; if interactive |
POSIX mode; if interactive |
|
|
if login |
if login |
sh-compat mode; if login |
|
if login |
if no |
sh-compat mode; if login |
|
if login |
||
|
if no |
||
|
if login |
||
|
if not login AND interactive |
||
|
always |
||
|
if login |
||
|
if interactive |
||
|
if login |
||
|
if login |
||
|
always |
||
|
if login |
||
|
if interactive |
||
|
if login |
Order of launch
Zsh
-
/etc/zshenv
-
$ZDOTDIR:-$HOME/.zshenv
-
/etc/zprofile
-
$ZDOTDIR:-$HOME/.zprofile
-
/etc/zshrc
-
$ZDOTDIR:-$HOME/.zshrc
-
$ZDOTDIR:-$HOME/.zpreztorc
-
/etc/zlogin
-
$ZDOTDIR:-$HOME/.zlogin
-
$ZDOTDIR:-$HOME/.zlogout
-
/etc/zlogout