Skip to main content
Shell scripting is the practice of writing executable text files that interpret and execute commands in a Unix-like shell. While Bash (Bourne Again SHell) is the most common shell today, there are many others: Use shell scripting when referring to any shell. If you depend on Bash-specific features (arrays, [[ … ]], 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 (like sh and zsh) can behave differently.

1. zsh Autocorrects Typos

Zsh offers a user‐friendly autocorrect feature:
Here, zsh automatically corrects LSls and FILE.TXTfile.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, -n is treated as text and printed.
  • Under bash, -n removes 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.

Watch Video