4 ms·
Running one command after another is trivial in most languages. The hard part is pipelines, which are inherently concurrent. For example, to pipe one subprocess
by chriswarbo 4y ago
Running one command after another is trivial in most languages. The hard part is pipelines, which are inherently concurrent. For example, to pipe one subprocess into another in Python requires spawning off separate threads to shuttle the data around (there are libraries which make this easier, but then your scripts will require a package manager...).
Shells are pretty decent at piping and spawning subprocesses. They suck at anything algorithmic, numeric, etc. Thankfully those tasks can usually be handed off to a separate tool (e.g. classic Unix text processing tools, like sed/grep/cut/etc., or more recent data processing tools like jq, mlr, etc.)
- rr888 4y agoRight, I really meant in a proper programming language you'd use high level libraries to do this work, rather than shelling sub processes. You wouldn't need sed/grep/cut.