0

Inspired by What is the difference between “base64 -b0” in macOS versions prior to macOS 13 (Ventura) and “base64 -i” in macOS 13 (Ventura)?

Are there common ways to avoid the script breaking on a system with a different version of a command, at least when you know what the differences are? Would checking the command --version or --help output and calling it with different options make sense?

3
  • 2
    That's what the configure scripts of a lot of software do (based on autoconf). Run a bunch of commands with different options and test inputs to determine which particular toolset and release they have.
    – muru
    Commented Feb 6 at 5:19
  • Having a build step for a few-line shell script seems like overkill.
    – typo
    Commented Feb 8 at 4:11
  • Maybe. You asked if X made sense, I said a commonly-used tool Y does X. Now whether you use X in your software or Y is up to you. ¯\_(ツ)_/¯
    – muru
    Commented Feb 8 at 4:18

0

You must log in to answer this question.

Browse other questions tagged .