3 ms·
> The Bashism is seldom needed I wish that were true. But posix shell lacks two fairly vital features: sane trap and process redirection. In an ideal world the
by patrec 6y ago
> The Bashism is seldom needed
I wish that were true. But posix shell lacks two fairly vital features: sane trap and process redirection. In an ideal world the posix comittee would just fix that, but I won't hold my breath.
- thomasbacklund 6y agoIt sounds like you need Bash then :) I totally agree Bash has some powerful features, some I go out of my way to reimplement in sh (as for example string operations [0]). But not all can ofc be replicated then bash it is. Maybe then: sh->bash->python/perl [0] https://gitlab.com/space-sh/string/-/blob/master/Spacefile.sh https://gitlab.com/space-sh/string/-/blob/master/Spacefile.s...
- bewuethr 6y agoI was going through the changes introduced in Bash 5.1, and to my surprise, it mentioned[1] that process substitution is now enabled in POSIX mode. I wondered if that means POSIX sh now supports it, but I haven't been able to find evidence for that, neither in the POSIX spec nor in the bug tracker of POSIX mailing list archives. Similarly, I remember reading about POSIX sh supporting arrays at some point in the future, but for the life of me, I can't find any evidence for this either. [1]: https://git.savannah.gnu.org/cgit/bash.git/tree/CHANGES#n538 https://git.savannah.gnu.org/cgit/bash.git/tree/CHANGES#n538
- patrec 6y agoArrays in shells generally suck (and behave quite different between different shells, e.g. zsh arrays are nothing like bash arrays), so I hope they don't make it into posix. OTOH, process substitution is a perfectly elegant and nice feature that fits well into the original design of bourne shell, removing an obvious limitation of pipes. It also behaves pretty much the same across shells that have it, so it should be much easier to standardize.