What is a shell, and how is Bash different from sh, dash and zsh?
BeginnerConceptShells, scripts and execution
Answer
A shell is a command interpreter: it reads commands, expands them, and starts programs. sh is the POSIX standard language, implemented on Debian/Ubuntu by dash (small, fast, no arrays or [[ ]]) and on RHEL by Bash in POSIX mode. Bash is a superset of POSIX sh with arrays, [[ ]], (( )), process substitution and better interactive features. zsh is the macOS default interactive shell; it is mostly compatible but differs in word splitting and array indexing (arrays start at 1).
In production we write automation in Bash with an explicit #!/usr/bin/env bash shebang, and only target POSIX sh when the runtime forces it (Alpine, BusyBox, minimal containers).
More on Shells, scripts and execution
What does the shebang line do, and why prefer `#!/usr/bin/env bash` over `#!/bin/bash`?BeginnerWhat is the difference between `./script.sh`, `bash script.sh` and `source script.sh`?BeginnerWhat happens when you type a command name? How does Bash decide what to run?AdvancedWhy must `cd`, `export` and `read` be builtins rather than external programs?IntermediateWhat is the difference between a login, interactive and non-interactive shell, and which startup files run?IntermediateWhat does `exec` do in a script? Give two uses.Advanced