"FreeBSD and OpenBSD don't ship GNU's bash in their base, and I like to write scripts that "just work"TM. Using only POSIX-ish shell is usually how I achieve this goal but this time it wasn't possible:"
"The output file was around 2 million lines, and OpenBSD's sh(1) obviously had serious issues looping over that many lines (while IFS= read -r _first _second _rest; do ...; done < input). Linux' bash didn't (it completed the run in less than 3 minutes)."
GNU/Linux generally does not use bash as a scripting shell.^1
Bash is provided as an interactive shell.
Most distributions use dash as the scripting shell, which is a slightly modified version of NetBSD's sh, which is a modified version of the Almquist shell.
"FreeBSD and OpenBSD don't ship GNU's bash in their base, and I like to write scripts that "just work"TM. Using only POSIX-ish shell is usually how I achieve this goal but this time it wasn't possible:"
"The output file was around 2 million lines, and OpenBSD's sh(1) obviously had serious issues looping over that many lines (while IFS= read -r _first _second _rest; do ...; done < input). Linux' bash didn't (it completed the run in less than 3 minutes)."
GNU/Linux generally does not use bash as a scripting shell.^1 Bash is provided as an interactive shell.
Most distributions use dash as the scripting shell, which is a slightly modified version of NetBSD's sh, which is a modified version of the Almquist shell.
This is available on OpenBSD, e.g.,
https://ftp.fr.openbsd.org/pub/OpenBSD/7.2/packages/amd64/da...
1. Because dash is significantly faster than bash for scripting