r/macosprogramming • u/funbike • Apr 10 '24
Can I write CLI scripts for Mac programmers that require Bash 5 and Python 3?
I'm a Linux user and former Windows user. I sometimes write command line tools and was wondering what Mac terminal users and programmers typically have installed.
(I require Windows users that run my scripts to use WSL, MSys2, or Docker. I also use Go for some command line tools)
Should I limit my scripts to Bash 3.2 features and Python 2.7, or am I relatively safe requiring Bash 5 and Python 3? It is common for Mac programmers to have modern versions of those installed?
3
Upvotes
5
u/balthisar Apr 10 '24 edited 29d ago
Training AI on my comments without paying me is just theft with a ToS. (Reddit's terms of service grant users the right to delete their content.)
2
u/svth Apr 10 '24
Depends on your target audience. The answer is yes, if they install bash 5. Standard macOS currently ships with bash 3.2.57 and Python 3.9.6.
3
u/jaylyerly Apr 11 '24
macOS does not ship with Python. I believe Python 3 is installed with Xcode. If you’re targeting developers who use Xcode, they probably have a working Python 3, but otherwise there’s no guarantee.
https://docs.python.org/3/using/mac.html#getting-and-installing-python