A peek at POSIX sh's future goodies
While it feels like POSIX.1-2024 got released just yesterday and a lot of shells/coreutils
still aren't fully conformant (e.g. test -nt/-ot in bash/zsh, read -d or OpenBSD/NetBSD/MacOS often lagging behind), I've been perusing the Austin
Group bug tracker to get an
idea of what's (almost certainly?) slated for the coming Issue 9.
mktemp -d §
That's the big one, alright. Especially with -d mind you, as POSIX already had echo 'mkstemp(/tmp/tmp.XXXXXX)' | m4 for the file variant (as used in my current shim).
Some of you may underestimate how often you want temporary directories in scripts.
xargs -P §
Together with the previously standardized -0 option and NPROCESSOR_ONLN, finally an ergonomic way to get parallel command execution! A bit of duck taping later and we
got tr '\n' '\000' | xargs -n1 -r -0 -P$(getconf NPROCESSOR_ONLN) $cmd. Even more
fiddling and the use of sh -c '...' argv0 as command can get you almost everything you
could want from GNU parallel modulo the distributed features (cf pararun).
The rest §
Some comparatively less important stuff in no specific order:
- \A and \z in (extended) regular expressions, link.
vi/ex -u RCFILEto specify a different configuration, link.find -perm /OCTALto match files with any of their mode's bits set inOCTAL, link.xargs -oto reopen stdin as/dev/ttyin order to use with interactive commands, link.
And finally, two interesting requests currently in the "Under Review" state: standardize more grep and diff options.