3 ms·
I feel like I've written this comment a million times but here it is again. Shell scripts are mainly written in order to automate subprocess-heavy tasks or to
by sneed_chucker 2y ago
I feel like I've written this comment a million times but here it is again.
Shell scripts are mainly written in order to automate subprocess-heavy tasks or to take advantage of the general availability of bash or bourne-compatible shells on most modern Unix based systems.
If you want things like reasonable variable scoping, real functions, loops, libraries for path and string manipulation, or a sane separation between what is and isn't a string, then Python is the obvious choice.
Yes, Python's subprocess module is less convenient than doing a subprocess call in Unix shell, but you can replace grep, sed, awk, find, and similar common subprocess calls in shell scripts with library and built-in functions in Python. The end result tends to be more a readable, maintainable, and testable script.
Python 3 also gets installed by default on nearly all non-minimal Linux distros these days. SBCL gets installed by default nowhere.
- hatmatrix 2y agoThe downside of this is that Python is not a Lisp.
- vindarel 2y ago> SBCL gets installed by default nowhere. for this, it's easy to build a binary.
- neilyio 2y agoI use shell scripts left and right for all kinds of things in my regular dev workflow. Running tests with various configurations. Complex tmux layouts. Syncing non-got data. I could go on and on. Common Lisp would be an incredible asset for this, as Babashka already is in the Clojure world. The REPL alone makes writing/maintaining these scripts very efficient. Why do you feel like Python must be the choice for everyone?
- Jtsummers 2y ago> Python 3 also gets installed by default on nearly all non-minimal Linux distros these days. SBCL gets installed by default nowhere. By that rationale we should only use languages which are installed by default on most systems. That's a severe reduction in the number of languages available for people to use.
- phlakaton 2y agolaughing in m4
- p_l 2y agoThe way I see it, the last time I could rely on Python being reasonably available, the version was 2.4
- deleted 2y ago[deleted]