Sample Header Ad - 728x90

Is there an equivalent of caniuse for commands on posix systems?

8 votes
3 answers
751 views
I'm thinking about using a callout to the jq command in a utility script I'm writing, rather than parsing JSON manually. In order to make the script as portable as possible, I want to know which flavors of Unix/Linux/MacOS/WSL/etc support this command without any additional package installation. Likewise, in the past, I've found that some scripts use call-outs to wget, which is missing in at least one flavor by default. That got me thinking: Is there any sort of tool that tells people whether it's "safe" in this way to use an arbitrary command in their scripts? Ideally, it would act like the caniuse site by showing which major flavors do and don't support a command in their default shells. === EDIT: With thanks to user Kusalananda for pointing out that my examples aren't POSIX commands, I changed the title to avoid mislabeling them as such.
Asked by Viscountess of the Junkyard (83 rep)
Jul 19, 2024, 09:18 AM
Last activity: Jul 27, 2024, 10:49 PM