From the course: macOS for IT Administrators

Unlock the full course today

Join today to access over 22,400 courses taught by industry experts or purchase this course individually.

Creating your script

Creating your script - Mac OS Tutorial

From the course: macOS for IT Administrators

Start my 1-month free trial

Creating your script

- [Instructor] The top line of any script is called a shebang. It starts with a number symbol and then the exclamation mark and then the path to the script language that will be contained in the script or the shell. Bash was the default shell for scripting until macOS 10.15, at which point the default shell changed to Zsh. There's no big deal there, however. When writing a Zsh script, you just call it out. Zsh is just the default shell now, not the only shell and all of your previous Bash scripts will work because Bash is called out at the top of those. You're calling out your shell at the top of every script, so it really doesn't matter that the default is changing. Besides, much of what works in Bash continues to work in Zsh, so anything new that you write in a Zsh shell, if you're using your old Bash language, should work just fine. After that first line, everywhere you see a number sign at the front of a line of…

Contents