4 ms·
Bash is the language used to express the unix philosophy: https://en.wikipedia.org/wiki/Unix_philosophy https://en.wikipedia.org/wiki/Unix_philosophy It is ver
by hayst4ck 4y ago
Bash is the language used to express the unix philosophy: https://en.wikipedia.org/wiki/Unix_philosophy https://en.wikipedia.org/wiki/Unix_philosophy
It is very much worth a read.
Besides the idea that command line programs are written primarily for the purpose of being composable, and that they follow a philosophy that makes them easy to work together, I think there are a few other pieces of secret sauce.
The lack of boilerplate is a major advantage. Low boilerplate bash pipes means input/output to/from another program is trivial. Exit code behavior as well as error behavior (output to stderr) further enhances the ease of composing individual tools to do something that would take a while to write a script to do.
The power of bash is that just about anything is trivial if it has the form:
get_data | (map/filter |)* | perform_action
Bash can be an optimal tool for just about anything that does not require "joining" different types of data or "branching" behavior.
Once you invoke branching, joining, or complex data structures/formats, bash is no longer the right tool and python is probably the right one (although if ruby had come first, it is actually probably better for relatively simple scripting).