I am relatively new to bash.
I had bash 3 In my mac by default.
GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin18)
Copyright (C) 2007 Free Softw
The bash -version
(or bash --version
) command tells you the version of Bash that you would get if you ran bash
.
But I'm guessing that you're not manually running bash
; rather, you're just opening the shell, which is probably still the older version of Bash. (It's quite possible, and not even that unusual, to have two copies of Bash installed on a system in different locations.) To check this, you can run echo "$BASH_VERSION"
to see the version of Bash that you're actual typing in.
To fix this, you will need to configure your machine to use the newer version of Bash as your shell. (Or you can just run bash
manually.)