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

前端 未结 3 772
南笙
南笙 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:16

    If you have two versions of bash installed, you need to make sure you are running the right one. In a script you need a first line like:

    #!/usr/local/bin/bash
    

    (Adjust path as necessary for your installation.)

    If you are interactive, make sure you are actually running the version of bash you expect, not just that it's the first 'bash' in your search path.

提交回复
热议问题