POSIX shells languages however, are awfully designed (including zsh/fish for historical compatibility with POSIX concepts reasons).
Something close to TCL as a shell would be much better.
POSIX shells languages however, are awfully designed (including zsh/fish for historical compatibility with POSIX concepts reasons).
Something close to TCL as a shell would be much better.
They also neglect parallel, concurrent, async programming. Which agan is fine for a shell language. The shell does have use cases for simple parallel processing and you can delegate to dedicated unix tools for that and it works great. If you need more, you're expected to jump into a more powerful environment.
So they're poor in data structure variety, and more interesting (nonsequential) ways of executing programs, which, again, is fine for a shell language, but those were exactly the things I wanted. I wanted to pipe and tee a bunch of programs programs into one "executable graph" a la dataflow programming using bash or something similar, but quickly understood that due to the above reasons I need a different environment. I'm still on the lookout for good dataflow programming environments.
My issue is their tons of subtle points (e.g. behaviour of [ vs [[ blocks), blatant disregard for the principle of least surprise, lack of some very basic items (not parallel, async etc programming -- a mere list and a mere map with an obvious syntax and no BS caveats would do), inelegant ad-hoc accretion of features, bad error handling, and so on. Those things can (and frequently do) trouble programmers even an one-liner.
I don't with e.g. something like bash supports writing a full 10K program with it.
But I wish it didn't make a 100-line shell script so clumsy and frail.
I don't know which level of intellect is required here for a newcomer to fix a bug.
[1]: https://github.com/zdharma/fast-syntax-highlighting/blob/mas...
Async:
long_running_cmd & > results.txt
cmd_pid=$!
# other stuff
wait $cmd_pid
# do something with results, if you want
Parallel: for script in "${scripts[@]}" ; do
"$script" &
done
wait
Dataflow: mkfifo my_channel
mkfifo another_channel
my_cmd > my_channel &
tee my_channel \
>(cmd1) \
>(cmd2 > another_channel) &
another_cmd < another_channel
But if you want a useful dataflow environment, I really recommend checking out [Nextflow](https://www.nextflow.io/). I use it at work for constructing bioinformatics pipelines, and it's really natural. The "preview" DSL2 is worth looking at, as well.