The new globstar
option requires bash 4
. So.. Which bash
are we on?
$bash --version
GNU bash, version 4.4.12(1)-release (x86_64-apple-darwin16.3.0)
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
Let us try out globstar
:
13:39:28/forecast-fresh $shopt -s globstar
-bash: shopt: globstar: invalid shell option name
13:39:32/forecast-fresh $
Is there any way to get support for this on macOS?
Best Answer
Entering
shopt
will get you a list with all bash options which doesn't include globstar for Apple's bash. Probably bash is compiled without support for this option.To get a bash executable with globstar install brew and brew's bash:
Then change the default shell opened in Terminal to /usr/local/bin/bash-terminal-app and to suppress the 'Do you want to close this tab?' prompt when closing windows and tabs, add 'bash' to the list of exclusions.
The new option list is then:
Under certain circumstances /usr/local/share/ and its subfolders are owned by root (e.g after installing smartmontools, nmap, node etc. with their custom installers) and some of the steps fail. In my opinion it's save to
chown -R
the folders to the admin user who installed brew/bash. In my almost vanilla install of macOS and brew, /usr/local/share and /usr/local/share/locale are owned by this admin user.