I can't use bash 5 syntax even after configuring it in MacOSX

前端 未结 3 811
南笙
南笙 2021-01-25 19:54

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         


        
3条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-25 20:23

    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.)

提交回复
热议问题