4 ms·
Shell scripting languages generally make certain common tasks easy that most other scripting languages do not. Namely, process management and especially piping
by stormbrew 8y ago
Shell scripting languages generally make certain common tasks easy that most other scripting languages do not. Namely, process management and especially piping information through those processes.
If that's most of what a program is doing I would 10000 times rather read a script written in bash doing it than a python script that pulls in 800 dependencies just to get halfway to making these sorts of tasks take less than 5 lines for each invocation of a thing that takes less than 1 line in bash.
That's not to say that bash is perfect, but it is very good at what it does.
- codedokode 8y agoShell script also has dependencies: specific version of shell and CLI utilities. Shell script is a good thing when you need to write something quickly with hacks but it is not a good foundation for init system or build system. They easily break if you redefine variables like IFS, add command aliases or use names with spaces or special characters.
- grumpydba 8y ago> Shell script also has dependencies: specific version of shell and CLI utilities. Just use posix stuff. And move on.
- hdfbdtbcdg 8y agoI'm curious. How do you for example parse command line arguments in your shell scripts? Do you regard sed, grep and awk as dependencies when bash scripting? With regards Python. The subprocess, os, sys etc modules are standard library modules. There is no dependency overhead in using them. Most smaller Python scripts manage very nicely with the standard library.
- int_19h 8y agoFor the kind of thing you've just described, a Python script would need just one dependency to do it all in roughly the same number of lines: https://amoffat.github.io/sh/ https://amoffat.github.io/sh/