You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is because the stock version of the bash shell on macOS, even the latest version of macOS (which, at the time of writing, is Big Sur 11.5.2), is old - at version 3, from 2007. Specifically, the full version information shown is:
GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin20)
Copyright (C) 2007 Free Software Foundation, Inc.
Related, and worth mentioning (although it's not directly related to the error described): With the advent of macOS Catalina a couple of years ago, the default login shell on macOS was changed, from bash to zsh.
The error described in this issue is a result of this old version of bash on your machine. You can fix this by installing the latest version which at the time of writing is 5.1.8.
In fact, to just address the issue here, you only need to carry out the first step, which is to install the latest version of bash with Homebrew:
brew install bash
This will give you a modern bash at /usr/local/bin/bash. You can then simply invoke the getbtpcli script like this:
/usr/local/bin/bash /path/to/getbtpcli
you could even change the hashbang at the top of the script from:
#!/usr/bin/env bash
to
#!/usr/local/bin/bash
These two approaches work for this script, but you have to be explicit because the old version of bash (which is in /bin/bash) is still taking precedence. So to address this, add /usr/local/bin/bash to your $PATH environment variable, before anything else. You'd typically do this in your .bashrc file, like this:
export PATH=/usr/local/bin/bash:$PATH
If you want to go the whole way and upgrade your shell experience to the latest bash version that you've just installed (which will also address the change in default login shell mentioned above), then you can follow the rest of the instructions in that post.
This issue relates to the content in the 2021-09-01-btp-cli-installation branch of this repo.
Running the
getbtpcli
script on a standard macOS device results in an error similar to this:The text was updated successfully, but these errors were encountered: