3 ms·
But now you require gnu awk, it no longer works under posix (so for example busybox). Which sucks a bit.
by gray_-_wolf 6y ago
But now you require gnu awk, it no longer works under posix (so for example busybox). Which sucks a bit.
- patrec 6y agoIt'll work with more than gawk (e.g. mawk as well) but yeah, it will not work with busybox awk. In the context of an interactive shell command I doubt many people care much about posix; indeed I struggle to recall any context in which I ever cared about posix compliance as such. Unless you have an personal or professional interest in fringe operating systems posix compliance is mostly of interest as an imperfect proxy for answering the question will it work on both Linux, macOS/iOS (and maybe busybox). Anyway, I suspect the following is POSIX compliant: git status -s | awk 'gsub(/^ M /,"")' | tr \\0 \\n | ...
- patrec 6y agoUgh, should of course have been git status -s | awk 'gsub(/^ D /,"")' | tr \\n \\0 | ...
- gray_-_wolf 6y ago> Unless you have an personal or professional interest in fringe operating systems posix compliance I mostly hit things like these with alpine containers and openwrt. OpenWRT I guess could be considered "fringe operating system", but alpine (at least for containers) seems reasonably mainstream?