BugBash - GBJam5 Mac OS

broken image


The bash version that comes with Mac OS Sierra is still the old v3 dated back in 2007.

  1. Bug Bash Gbjam5 Mac Os Download
  2. Bug Bash Gbjam5 Mac Os Update
  3. Bug Bash Gbjam5 Mac Os Catalina
  4. Bug Bash Gbjam5 Mac Os X

GNU bash v4 has been introduced since 2009 that includes many new features, e.g. one of which is the shell option globstar ** that we used to recursively traverse directory hierarchy.

GET GNU bash

Race against ferrum gigantes mac os. GitHub is an important Repository used by Open-Source software developers, to provide downloadable executable files and to allow others to 'help' with development by rigorously checking out source files and checking in modifications when nearly finished.

We can get it with homebrew.

The reason that Apple includes such an old version of Bash in its operating system has to do with licensing. Since version 4.0 (successor of 3.2), Bash uses the GNU General Public License v3 (GPLv3), which Apple does not (want to) support. This explanation does not make sense. Shipping a GPL (v3 or otherwise) binary does not mean that the rest of the OS would need to be released. The rest of the OS does not link to bash. The 'Tivoization' clause might explain why bash can't be updated on, say, an Apple TV, but not really on a desktop Mac. Furthermore, 'GPL'd portions' already. This video shows how to install downloaded brushes into GIMP on your Mac. Good resource for downloadable GIMP brushes and much more is deviant art.

homebrew GNU bash looks good with version v4.4.12. Let's install:

Check if our GNU bash is now the default one:

Make sure /usr/local/bin/bash is at the top of the list. Dreamwillow mac os. If it isn't and /bin/bash is at the top, edit your .bashrc or .bash_profile to have the proper $PATH setting:

Our terminal bash should now be the GNU bash v4.4.12:

And we're done.

Issue

… well, not quite. Even though most of everything we do now on our terminal will run through the GNU bash thanks to the proper $PATH pointing to the correct version, our shell environment is still not fully set up properly.

E.g. we'll run to an error when trying to change a shell option:

Our version is bash v4.4.12 and it supports the globstar option. Why did we get the error when setting it? It's simply because even though our $PATH points to the correct GNU bash, there are other things going on when the terminal loads up our shell environment. So besides $PATH, we need to make sure our shell environment is loaded up properly as well.

We have 2 places to do that on our Mac.

OPTION 1: terminal DEFAULT

terminal is an Mac app that wraps our shell. By default terminal will run /bin/bash when it opens, but we can configure it to use GNU bash instead.

Go to Terminal > Preferences > Shell opens with, and choose the 2nd option Command (complete path) with the value /usr/local/bin/bash as follows:

This tells the terminal app to run our CommandGNU bash instead of the Default login shell/bin/bash when it opens.

Completely quit and then re-open terminal so it uses /usr/local/bin/bash, we can then change the shell option without any issue:

OPTION 2: DEFAULT LOGIN SHELL

For most people, the terminal option should be sufficient. However there are cases when you execute some shell script and even though your $PATH and terminal is set properly to use GNU bash, somehow the shell script complains about the default shell /bin/bash, where does it come from?

Crts are ancient, right? mac os. It comes from the shell environment variable $SHELL that is set by Mac OS for your user. Even with $PATH and terminal set to use /usr/local/bin/bash, $SHELL still has the /bin/bash value:

The discrepancy between our $PATH/terminal and $SHELL:

As you may have guessed, in our terminal's preferences, the Shell opens with's default option Default login shell was actually using the value of $SHELL.

We can change the value of $SHELL with the change shell command chsh.

First-attempt to change default shell to use GNU bash

Bug Bash Gbjam5 Mac Os Download

chsh reported back with the error non-standard shell, that is because we tried to set the GNU bash as the default login shell but it's not in the list of valid shells as specified in /etc/shells:

Second-attempt to change default shell to use GNU bash

Add GNU bash to the list of acceptable shells:

/usr/local/bin/bash is now in the acceptable shell list, let's change our default shell again:

Check that our shell is now the GNU bash:

Bug Bash Gbjam5 Mac Os Update

Another way to check if our $SHELL has been property set is to run the chsh command without any argument which will present an editable view of our user configuration:

Bug Bash Gbjam5 Mac Os Catalina

We can then exit without saving once we've verified that our shell is /usr/local/bin/bash.

Bug bash gbjam5 mac os catalina
Bug bash gbjam5 mac os catalina

You should logout and re-login for Mac to properly update your shell environment.

RECAP

Bug Bash Gbjam5 Mac Os X

  1. Install GNU bash with homebrew
  2. Configure proper $PATH
  3. Configure terminal to properly load the shell environment with either:
    • Choosing Command (complete path) with value /usr/local/bin/bash
    • Choosing Default login shell after setting $SHELL with chsh to use /usr/local/bin/bash

Updated 5/16/17 for Mac Sierra 10.12.4





broken image