| Shell | Year Introduced | Key Feature |
|---|---|---|
Bourne sh | 1979 | Original shell scripting standard |
| Bash | 1989 | Rich scripting constructs |
Z shell zsh | 1990 | Typo correction & plugin system |
Korn ksh | 1983 | Advanced variables & functions |
| Dash | 1997 | Focus on speed & minimalism |
[[ … ]], process substitution), say shell scripting with Bash.
Always include a shebang (
#!) at the top of your scripts to declare which shell to use:When to Use “Shell” vs. “Bash” Scripting
- Shell scripting – generic term for writing scripts in any shell
- Shell scripting with Bash – when your code relies on Bash-only features
- Shell scripting with zsh, ksh, etc. – when targeting those environments
Illustrative Differences Between Bash and Other Shells
Below are two examples that show how Bash and other shells (likesh and zsh) can behave differently.
1. zsh Autocorrects Typos
Zsh offers a user‐friendly autocorrect feature:zsh automatically corrects LS → ls and FILE.TXT → file.txt. Bash does not do this by default.
2. echo -n Behavior
The -n flag suppresses the trailing newline in Bash, but not in all sh implementations:
- Under sh,
-nis treated as text and printed. - Under bash,
-nremoves the newline as expected.
For portable scripts, avoid relying on
echo -n. Use printf instead:Conclusion
- Refer to any interpreter as shell scripting when you don’t need to specify.
- Use shell scripting with Bash (or another shell) if you rely on that shell’s extensions.
- For maximum portability and advanced features, Bash is the de facto standard.