Apple has had a very good yet little used power shell built into its OS for years its call Apple Script.
Apple has always been a stable operating system. It’s roots are in FreeBSD.
I’m about due an upgrade on this system and a new install. It will be some form of Linux or possibly OpenBSD.
Currently running Debian and XFCE.
Apple Script is the most godawful thing second only to iTunes.