3 ms·
For small scripts, bash is still the easier way to go. Other programming languages are not that immediate to do simple things. How many lines of code take pipin
by alerighi 6y ago
For small scripts, bash is still the easier way to go. Other programming languages are not that immediate to do simple things. How many lines of code take piping a command into another in python, for example?
Also bash is not portable, but you can assume to find a recent version of bash on any Linux system. And for BSD systems or macOS, you can install it with a command. And yes, there are other ancient UNIX systems, but who uses them? But what other programming language can you be sure to find on any system?
Finally, bash it's quite efficient. I mean that it doesn't have the weight that a full programming language like Python has, especially the time that it takes to activate the program interpreter. That could make a difference in scripts that are executed a lot of time from other script or other programs. Or even in wrapper scripts, since they doesn't add noticeable delay when executing a command.
There is still a reason to use and know bash to me. Of course implementing whole programs in bash doesn't make sense, but for simple scripts it does.
- andrewshadura 6y ago> How many lines of code take piping a command into another in python, for example? None. from sh import sort, du from glob import glob print(sort(du(glob("*"), "-sb"), "-rn"))
- eru 6y agoLooks like three lines to me?