Bash versus other shells
A huge variety of shell programs exist for Unix-like environments; you could argue that one of the major reasons for Unix’s popularity is the fact that it’s always been an environment with essentially no barriers to scripting and automation.
This chapter teaches you how to write your own scripts in Bash. Much of what you’ll learn here will also work on other shells (for example, ksh
and other common minimal shells that you’ll find at /bin/sh
), but we’re focused on Bash here.
If you’re writing a shell script, Bash strikes the perfect balance between wide availability and a language feature set that’s large enough to make it comfortable to write small programs.