|
|
|
|
|
by valenterry
1969 days ago
|
|
There is a reason why no one uses shell for anything more complicated. E.g. start two long-running commands and then close the one of them depending on some later output of the other one or vice versa. If that's not already complicated enough, we can easily add things like, execute a command A and then another other commands (B, C, D) and, only once all these are finished, run a cleanup command D. But run D always, no matter wether B, C, D fail (think of closing a database connection). And now treat this whole thing as yet another command E, that itself can be used in the same place as e.g. B or C or D before (= composition). Shell is great for many common tasks, but I would never call it beginner-friendly, even less "trivial to use for concurrency". |
|
1. It's not generally taught in CS classes, and people just search up enough syntax to be able to acomplish their task.
2. A lot of it's variable expansion/substitution are remiscient of Perl.
3. Small mistakes can have huge impact (everyone knows how often rm -rf of unintended directories takes place). Just for the fun of it, I suggest everybody reads at least once the Unix Haters Handbook https://web.mit.edu/~simsong/www/ugh.pdf
If I understood your task correctly, it can be done just nicely in the shell (after all, this is what I think the shell excels at). You'll see the unpleasant side of it when dealing with function arguments and slicing values and referecing specific ones. I don't guarantee it does what you want to the letter, but just my quick interpetration of your description.