Skip to main content

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

I've been reading about and practicing my bash-fu for the past year. How big of a compatibility issue are we talking about? This seems like a really big deal, but I don't want to over react.


It's not that big of a deal, it can be changed.
http://osxdaily.com/2012/03/21/change-shell-mac-os-x/


There also giving the warning sign of bash being depreciated latter, similar to 32bit.


Well that is a bigger deal.


@ryan.ball An even bigger deal is (per Krypted.com) scripting languages such as Python, Ruby, and Perl are all being deprecated. Not gone in 10.15, but deprecated... so the writing is on the wall.

Repeat after me... security is your friend, citizen. freedom is slavery. we have always been at war with... Eh. I never spent much time with those and it almost makes sense in the name of security. But it's going to suck to go through all my scripts and find my bits and pieces of perl and python.


this is beginning to get crazy -_-


In theory, for the time being, as long as your scripts have the appropriate shebang it shouldn't be a problem.


So what does this mean that every script written in Bash,Shell is going to break and no longer work?

I guess i see JAMF NATION working in overtime in the near future.


@CorpIT_eB In theory your scripts will be fine as long as your shebang is set right (and that Apple haven't removed that shell!).


@cwaldrip This is a VERY bad sign. For us OS X became very useful due to the unique mix of the underlying BSD including all the possibilities to do scripting, the nice GUI including office apps and the development environment. If Apple really prohibits shell scripts and all widely used scripting languages the Macs will become much less useful. We don't need iPad+'ses, we need real computers. No scripting = no point to buy a Mac.


Nothing to stop you from installing Python and Ruby etc. during provisioning. I would imagine the change is due to the versions bundled and their licensing terms are no longer compatible so Apple are just dropping them instead of having to agree to different licensing terms.


@allanp81 that's my guess too. Apple can't try and test and keep the various scripting languages up to date. And too many people just use what's installed. I'm surprised Apache is as current as it is for example. Apple doesn't bundle Java anymore, but you're free to install it and use it.

As for existing scripts, as long as the scripting language is installed then your scripts will work. Converting bash to zsh doesn't seem too hard, just annoying. But relying on those others will mean you'll have to add them to the machine at imaging time. And that's going to be a PITA.


the version of zsh that Apple ships is modern, and bash 3.2 will never be updated nor patched because it is GPLv3. Honestly, zsh is pretty good and I have been tinkering with it and using it for a few years now. This isn't even a surprise to me. The efforts to migrate code from bash to zsh should be pretty minimal. Also, I doubt they will kill bash anytime soon because internals rely on it. However, I would definitely look at adopting zsh moving forward.

My 2 cents

-Tom


I've switched my default shell to zsh, and now testing any new scripts as #!/bin/zsh to see if they work as intended. (edit) As well working with any normal command line I use in zsh to see the effect.

Will start testing older scripts, and picking up this book "From Bash to Z Shell: Conquering the Command Line by Kiddle, Oliver" Any suggesting for other good books on zsh?


Thanks


What sucks is that we use the code and technique that @haircut wrote about here: Automatically Renaming Computers from a Google Sheet with Jamf Pro that works flawlessly except we use an internal iis server instead of Google drive.

We love it having to come up with another solution for computer naming breaks my heart.


If python is removed for good, the Mac Admin community will need a new recommended way of finding the currently logged in user.

Most everyone I know runs MacMule's command to gather the user.


This method works fine in zsh


You should look at shipping your own Python, Perl, and Ruby as well if you want to use those languages. Apple is likely to stop shipping those.


Posted: Today at 3:58 PM by koalatee This method works fine in zsh

Those should work, as that isn't a part of bash, but that is a part of the scutil binary. All binary I/O will work fine in zsh it is only the built ins and possibly very minor syntax changes that you may run into.


I'm not too clear on Apple's NDA rules....so I am chicken to post details. However, from my 1st test Catalina enrollment .. I think there are more pressing and bigger impacting issues. I would hope that everyone here is testing and filling bugs. That said with Apple making changes whenever they feel like it, it's not to hard to see that some of the issues will change over the next few months.

C


@allanp I don't really see shipping own versions of python, perl ruby etc as a solution. We are a BYOD environment, almost everything on our site is done via the Self-Service. If there is no more perl, python ruby etc shipped by Apple I can not assume anything about the presence or the version of these. It will be a mess.

And there is another issue that worries me a lot. Apple is closing off more and more areas of the OS. Good for security, very bad for people that use plenty of scripts and home grown software. Before OS X came along it was VERY difficult to script/program the Mac, and Mac usage here dropped significantly. OS X (now called macOS) opened up the Mac and made it a much more useful tool. Now Apple is restricting it more and more, and the usefulness of the Macs will decrease again.


@mschroder To be honest if it meant we had to drop the macs then it would be a good thing anyway, can't stand them!


There are lots of things that are and have been depreciated in macOS/OSX for quite a while, but are still baked into the OS.


@mschroder I talked to an Apple engineer recently, 2 weeks ago roughly, and he told me that Apple is advising customers to "move away from scripting".

That shocked me. I immediately knew what they would move to, though. They want admins like us to be nothing more than 3rd party tool users, like JAMF or... dare I say it... Apple's new management tool. I believe apple is going to start offering companies direct access to MDM and configuration profile controls just like JAMF gives us. Apple will give the keys to options they decide we can change; the implementation will be left to Apple. We simply flip the switches.

Their goal with this is, less support and more control for Apple. Sad times imo. Sad times.