3 ms·
This uses Bash extension not available in POSIX. Bash also has lastpipe shopt that helps when one needs to read from a process. To stay compatible with POSIX o
by _0w8t 5y ago
This uses Bash extension not available in POSIX. Bash also has lastpipe shopt that helps when one needs to read from a process.
To stay compatible with POSIX one needs to use either named pipes or extra file discriptors to communicate from the sub shell.
- aaaaaaaaaaab 5y agoYeah, but in my experience limiting yourself to the POSIX sh feature set is almost always just nitpicking. Bash is ubiquitous enough that this is hardly a problem in practice.
- _0w8t 5y agoIn my opinion the moment POSIX shell is not enough, one better use more appropriate language than learning all Bash-specific syntax rules and exceptions. And with containers bash may not be even there.
- aaaaaaaaaaab 5y agoWhich language would be better than bash for building concurrent pipelines from other utilities? Sure, you can build pipelines in Python via the subprocess module, but it’s not exactly an ergonomic API…