Bourne Shell
This page is relevant to all Bourne Shell derivatives. This includes:
- Bourne Shell (sh)
- Bourne Again Shell (bash)
- Korn Shell (ksh)
- Z Shell (zsh)
- Almquist Shell (ash)
- Debian Almquist Shell (dash)
Includes: if, select, case
Includes: tail, vim, sed, grep, awk, q
Version
Version
bash --version
On AIX you cannot readily see the version of ksh but you can see the version of the installed bos.rte.shell package...
lslpp -L | grep ksh
Shell Prompt
Shell Prompt
The prompt is defined by the $PS1 environment variable
Which Shell is being used?
Which Shell is being used?
ps -p $$
The Different Shells
The Different Shells
/bin/sh is the "default" shell and is assumed to be POSIX compliant. In Linux /bin/sh is often symbolically linked to bash but this should not be assumed. i.e. don't start your script with #!/bin/sh and then use bash specific features as you are likely to be caught out. For example, recent versions of Ubuntu link /bin/sh to a POSIX compliant lightweight shell variant call dash rather than bash.
Z Shell (zsh)
Z Shell (zsh)
Zsh is an extended Bourne shell with many improvements, including some features of Bash, ksh, and tcsh.
Zsh is available as a separate package for Microsoft Windows as part of the UnxUtils collection
Zsh is the default login shell for MacOS Catalina
Zsh is the default login shell for Kali Linux (since 2020.4)
Bibliography
Bibliography
https://en.wikipedia.org/wiki/Unix_shellhttps://senthilnayagan.medium.com/shebang-hashbang-10966b8f28a8
Fiddlershttps://rextester.com/
IDEshttps://replit.com/
Bourne Shellhttps://www.grymoire.com/Unix/Bourne.html
dashhttps://wiki.ubuntu.com/DashAsBinSh
POSIXhttps://www.grymoire.com/Unix/Sh.html
Shell Prompthttps://www.kirsle.net/wizards/ps1.htmlhttps://www.howtogeek.com/307701/how-to-customize-and-colorize-your-bash-prompt/
Fiddlershttps://rextester.com/
IDEshttps://replit.com/
Bourne Shellhttps://www.grymoire.com/Unix/Bourne.html
dashhttps://wiki.ubuntu.com/DashAsBinSh
POSIXhttps://www.grymoire.com/Unix/Sh.html
Shell Prompthttps://www.kirsle.net/wizards/ps1.htmlhttps://www.howtogeek.com/307701/how-to-customize-and-colorize-your-bash-prompt/