← Back to context

Comment by waynesonfire

1 day ago

This misses the point of shell scripts.

OUTPUT=$(some_command)

is the killer app of sh scripts among other things, like being universally available. Any language, including this, can execute a command. It's the ergonomics that matter. Shell scripts reduce the impedence of interacting with the shell to control the OS. At first sight, this tool does'nt improve on that impedendance. It also invents it's own esoteric syntax, so what's the gain?

On a separate point but equally important, I don't understand why sh scripts are exempt fom unit tests. Do these tools alleviate that?

> On a separate point but equally important, I don't understand why sh scripts are exempt fom unit tests.

Likely because:

- it's an older culture than unit testing

- people write shell scripts for one shot tasks, or to automate tasks which are system setup/configuration specific

- if a shell script becomes useful enough, it gets rewritten in a more apt language