Elektrine lite

← Feed

@tejr@mastodon.sdf.org

Post #3207986

2026-04-26 07:40 UTC

@minoru@functional.cafe It's not so much the waiting-on-all function as the fact that it always exits 0; you lose all the exit values from the forked commands. That can be awkward in other languages too, but it's especially painful in POSIX shell script.

Replies (1)

  • @minoru@functional.cafe 2026-04-26 15:28

    @tejr@mastodon.sdf.org Yeah, losing the error state is what I called cursed. What other languages have an equivalent "wait for all children" function? In C, C++, and Rust the programmer would have to write this footgun by themselves. Also, returning an array of exit codes would be cool, but there are no arrays in POSIX shell =\ Which is my other rule of thumb: the moment you need something more complex than a string or integer variable, switch to something that supports actual data structures, and no, BASH is not it :)

    Open ##3207987