Heads up for admins, zsh in now default shell for macOS Catalina

garybidwell
Contributor III

Just a heads up as it wasn't in the main presentation yesterday, but bash is no longer the default shell for macOS

https://support.apple.com/en-us/HT208050

49 REPLIES 49

scottb
Honored Contributor

Well, it was going that way anyway, but what I am happy about is that the Full Disk Access items are pre-populated in unchecked state to not have to figure out WTH? goes in there...

CorpIT_eB
Contributor II

@tlarkin I was very intrigued to see everything that is now going under UPP now.

6e22cd0e4fd54f5a88f30f14e08d5033

tlarkin
Honored Contributor

ya I typically stay out of user space as much as I can as a general rule.

CorpIT_eB
Contributor II

@tlarkin as do but I, I agree it looks like there might be a-lot more to it now.

luke_reagor
Contributor II

In Cataline, will switching to zsh change how Jamf run scripts on macs? If I write a script in zsh (shebang and all) and scope it to a mac, will it be ran on the mac with the zsh interpreter?

cwaldrip
Valued Contributor

Nope. A user switching to zsh won't effect how scripts are run (which is why your scripts should begin by saying what they're using /bin/bash, /bin/sh, etc).

And, for now, bash, python, and the other languages being discontinued will continue to work... but they could go away in the future (probably with 10.16, but it could be 10.15.3 or something). So, take the time now to review all your shell scripts, and the scripts you may have in pkg installers.

And with Catalina the path to some things has changed. So, test all your scripts.

tlarkin
Honored Contributor

the jamf binary executes scripts as files, so whatever shebang you are using in code it will execute as. Also, technically bash is not going away, it is just no longer the default shell. There is also nothing stopping anyone from shipping their own bash version 5 binary either. There are still plenty of options to look at.

If there is any glaring lessons to be learned here, is that as an I.T. Admin/Engineer you should really use VCS systems and centralize your code in a repo, so in the event you need to convert or rewrite, it is a lot more easy than chasing downs tons of scripts. Also, try to write reusable static code, it makes things a lot easier.

valkyrie
New Contributor III

I'm a bit late to the game, but I haven't had time to check this until now.
I want to check if some of my current important scripts in Jamf (in bash) would still work should Apple decide to remove bash in coming versions. Sadly, ShellCheck doesn't support zsh. Is there another easy way to check if the script contains errors for zsh? Or is zsh --emulate sh an option for this?
I'm still quite new to Apple and Jamf, so I'm trying to figure everything out as I go.

taugust04
Valued Contributor

What prevents the install of python, perl, ruby, etc at high priority level at enrollment time with Jamf? (not a rhetorical question)

I feel like this will hurt developers a lot. Many of the big software vendors use some of these third party scripting languages in their installers...

arminBriegel
New Contributor III
New Contributor III

I did a presentation at MacSysadmin in Gothenburg, a series of blog posts and a book on this topic. https://scriptingosx.com/zsh